Commit 5d37c8d5 authored by 's avatar

more cleanup

parent 88f4bed7
...@@ -85,12 +85,10 @@ ...@@ -85,12 +85,10 @@
"""WebDAV support - resource objects.""" """WebDAV support - resource objects."""
__version__='$Revision: 1.2 $'[11:-2] __version__='$Revision: 1.3 $'[11:-2]
import sys, os, string, time import sys, os, string, mimetypes, xmlcmds
import mimetypes, xmlcmds from common import absattr, aq_base, urlfix, rfc1123_date
from common import absattr, aq_base
from common import urlfix, rfc1123_date
class Resource: class Resource:
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
"""WebDAV xml request objects.""" """WebDAV xml request objects."""
__version__='$Revision: 1.2 $'[11:-2] __version__='$Revision: 1.3 $'[11:-2]
import sys, os, string import sys, os, string
from common import absattr, aq_base, urlfix from common import absattr, aq_base, urlfix
...@@ -127,9 +127,8 @@ class PropFind: ...@@ -127,9 +127,8 @@ class PropFind:
depth=self.depth depth=self.depth
url=urlfix(self.request['URL'], 'PROPFIND') url=urlfix(self.request['URL'], 'PROPFIND')
result.write('<?xml version="1.0" encoding="utf-8"?>\n' \ result.write('<?xml version="1.0" encoding="utf-8"?>\n' \
'<d:multistatus xmlns:d="DAV:">\n' '<d:multistatus xmlns:d="DAV:">\n')
iscol=hasattr(aq_base(obj), 'isAnObjectManager') and \ iscol=hasattr(obj, '__dav_collection__')
obj.isAnObjectManager
if iscol and url[-1] != '/': url=url+'/' if iscol and url[-1] != '/': url=url+'/'
result.write('<d:response>\n<d:href>%s</d:href>\n' % url) result.write('<d:response>\n<d:href>%s</d:href>\n' % url)
if hasattr(obj, '__propsets__'): if hasattr(obj, '__propsets__'):
...@@ -184,8 +183,7 @@ class PropPatch: ...@@ -184,8 +183,7 @@ class PropPatch:
def apply(self, obj): def apply(self, obj):
url=urlfix(self.request['URL'], 'PROPPATCH') url=urlfix(self.request['URL'], 'PROPPATCH')
if hasattr(aq_base(obj), 'isAnObjectManager') and \ if hasattr(obj, '__dav_collection__'):
obj.isAnObjectManager and url[-1] != '/':
url=url+'/' url=url+'/'
result=StringIO() result=StringIO()
errors=[] errors=[]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment