Package: python-webdav
Version: 0.9.8-3
Severity: normal
Dear Maintainer,
when all properties for a resource and its children are requested,
pywebdav only returns the value of those properties that are also set
on requested collection itself. It does not return the properties that
are only on one of the children (or grandchildren for that
matter). Also, 404 is returned for any property that is on the
requested collection, but not on the current child.
The reason for this is that the list of property names is created once
in pywebdav.lib.propfind.PROPFIND.create_allprop() and applied to each
resource.
Here's a quick hack to fix it:
=== Begin ===
--- propfind.py.old 2013-06-01 17:03:19.031822359 +0200
+++ /usr/lib/python2.7/dist-packages/pywebdav/lib/propfind.py 2013-06-01
17:08:50.000000000 +0200
@@ -66,7 +66,7 @@
df = None
if self.request_type == RT_ALLPROP:
- df = self.create_allprop()
+ df = self.create_prop(allprop=True)
if self.request_type == RT_PROPNAME:
df = self.create_propname()
@@ -78,7 +78,7 @@
return df
# no body means ALLPROP!
- df = self.create_allprop()
+ df = self.create_prop(allprop=True)
return df
def create_propname(self):
@@ -118,17 +118,7 @@
return doc.toxml(encoding="utf-8")
- def create_allprop(self):
- """ return a list of all properties """
- self.proplist = {}
- self.namespaces = []
- for ns, plist in self._dataclass.get_propnames(self._uri).items():
- self.proplist[ns] = plist
- self.namespaces.append(ns)
-
- return self.create_prop()
-
- def create_prop(self):
+ def create_prop(self, allprop=False):
""" handle a <prop> request
This will
@@ -156,16 +146,25 @@
ms.tagName = 'D:multistatus'
if self._depth == "0":
+ if allprop:
+ self.proplist = self._dataclass.get_propnames(self._uri)
+ self.namespaces = self.proplist.keys()
gp, bp = self.get_propvalues(self._uri)
res = self.mk_prop_response(self._uri, gp, bp, doc)
ms.appendChild(res)
elif self._depth == "1":
+ if allprop:
+ self.proplist = self._dataclass.get_propnames(self._uri)
+ self.namespaces = self.proplist.keys()
gp, bp = self.get_propvalues(self._uri)
res = self.mk_prop_response(self._uri, gp, bp, doc)
ms.appendChild(res)
for newuri in self._dataclass.get_childs(self._uri):
+ if allprop:
+ self.proplist = self._dataclass.get_propnames(newuri)
+ self.namespaces = self.proplist.keys()
gp, bp = self.get_propvalues(newuri)
res = self.mk_prop_response(newuri, gp, bp, doc)
ms.appendChild(res)
@@ -173,6 +172,9 @@
uri_list = [self._uri]
while uri_list:
uri = uri_list.pop()
+ if allprop:
+ self.proplist = self._dataclass.get_propnames(uri)
+ self.namespaces = self.proplist.keys()
gp, bp = self.get_propvalues(uri)
res = self.mk_prop_response(uri, gp, bp, doc)
ms.appendChild(res)
=== End ===
Not sure why proplist and namespaces are instance variables rather
than getting passed as a parameter to get_propvalues() and why we
namespaces is a separate variable instead of just using
proplist.keys() in mk_propname_response(), so I haven't changed that.
-- System Information:
Debian Release: 7.0
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable'), (100,
'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.8-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python-webdav depends on:
ii python 2.7.3-4
ii python-pkg-resources 0.6.24-1
python-webdav recommends no packages.
python-webdav suggests no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]