[Zope-Checkins] CVS: Zope/lib/python/webdav - Collection.py:1.20.20.1 NullResource.py:1.29.8.1 Resource.py:1.45.8.1 davcmds.py:1.13.20.1
Shane Hathaway
shane@digicool.com
Thu, 9 Aug 2001 13:34:16 -0400
Update of /cvs-repository/Zope/lib/python/webdav
In directory cvs.zope.org:/tmp/cvs-serv29115/lib/python/webdav
Modified Files:
Tag: NR-branch
Collection.py NullResource.py Resource.py davcmds.py
Log Message:
Sync NR-branch with trunk. Sorry about so many checkin messages...
=== Zope/lib/python/webdav/Collection.py 1.20 => 1.20.20.1 ===
=== Zope/lib/python/webdav/NullResource.py 1.29 => 1.29.8.1 ===
body = REQUEST.get('BODY', '')
ifhdr = REQUEST.get_header('If', '')
- depth = REQUEST.get_header('Depth', 'infinite')
+ depth = REQUEST.get_header('Depth', 'infinity')
name = self.__name__
parent = self.__parent__
=== Zope/lib/python/webdav/Resource.py 1.45 => 1.45.8.1 ===
taglist = IfParser(ifhdr)
for tag in taglist:
+
if not tag.resource:
# There's no resource (url) with this tag
- taglist = map(tokenFinder, tag.list)
- wehave = filter(havetag, list)
+ tag_list = map(tokenFinder, tag.list)
+ wehave = filter(havetag, tag_list)
+
if not wehave: continue
if tag.NOTTED: continue
if refresh:
@@ -193,8 +195,9 @@
found = 1; break
elif urlbase(tag.resource) == url:
resourcetagged = 1
- taglist = map(tokenFinder, tag.list)
- wehave = filter(havetag, taglist)
+ tag_list = map(tokenFinder, tag.list)
+ wehave = filter(havetag, tag_list)
+
if not wehave: continue
if tag.NOTTED: continue
if refresh:
@@ -300,6 +303,7 @@
if parent.manage_delObjects([name],REQUEST=None) is None:
RESPONSE.setStatus(204)
else:
+
RESPONSE.setStatus(403)
return RESPONSE
@@ -419,6 +423,10 @@
ob=self._getCopy(parent)
ob.manage_afterClone(ob)
+ # We remove any locks from the copied object because webdav clients
+ # don't track the lock status and the lock token for copied resources
+ ob.wl_clearLocks()
+
ob._setId(name)
if depth=='0' and hasattr(ob, '__dav_collection__'):
for id in ob.objectIds():
@@ -538,7 +546,7 @@
creator = security.getUser()
body = REQUEST.get('BODY', '')
ifhdr = REQUEST.get_header('If', None)
- depth = REQUEST.get_header('Depth', 'infinite')
+ depth = REQUEST.get_header('Depth', 'infinity')
alreadylocked = Lockable.wl_isLocked(self)
if body and alreadylocked:
=== Zope/lib/python/webdav/davcmds.py 1.13 => 1.13.20.1 ===
if not top: return result
result.write('</d:multistatus>')
+
return result.getvalue()
@@ -352,7 +353,7 @@
self.scope = 'exclusive'
self.type = 'write'
self.owner = ''
- timeout = request.get_header('Timeout', 'Infinite')
+ timeout = request.get_header('Timeout', 'infinite')
self.timeout = string.strip(string.split(timeout,',')[-1])
self.parse(data)
@@ -388,6 +389,7 @@
result=None, url=None, top=1):
""" Apply, built for recursion (so that we may lock subitems
of a collection if requested """
+
if result is None:
result = StringIO()
url = urlfix(self.request['URL'], 'LOCK')
@@ -401,6 +403,7 @@
lock = LockItem(creator, self.owner, depth, self.timeout,
self.type, self.scope, token)
if token is None: token = lock.getLockToken()
+
except ValueError, valerrors:
errmsg = "412 Precondition Failed"
except:
@@ -475,7 +478,8 @@
method = getattr(obj, 'wl_delLock')
vld = getSecurityManager().validate(None,obj,'wl_delLock',method)
if vld: obj.wl_delLock(token)
- else: errmsg = "403 Forbidden"
+ else:
+ errmsg = "403 Forbidden"
elif not islockable:
# Only set an error message if the command is being applied
# to a top level object. Otherwise, we're descending a tree