davlib question

Carsten Gaebler clpy at snakefarm.org
Mon Jun 18 07:13:43 EDT 2001


Hi there!

I am using the davlib module to read some information from a WebDAV
server. First I read all property names for a specific directory (which
succeeds) and then try to get the value of the "getlastmodified" property
(which fails). I do not understand why it fails, perhaps someone could
give me a hint? The script and its output follow.

Regards
Carsten.

<davtest.py>
#!/usr/bin/python

import davlib

dav = davlib.DAV("dav")

# get all properties of directory
response = dav.allprops("/space1/2/d7055372/", 0)
print response.status, response.reason
print response.read()

print

# get 'getlastmodified' property of directory
response = dav.getprops("/space1/2/d7055372/", "getlastmodified")
print response.status, response.reason
print response.read()
</davtest.py>


<output of davtest.py>

207 Multi-Status
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response xmlns:lp0="DAV:" xmlns:lp1="http://apache.org/dav/props/">
<D:href>/space1/2/d7055372/</D:href>
<D:propstat>
<D:prop>
<lp0:creationdate>2001-06-18T11:00:04Z</lp0:creationdate>
<lp0:getlastmodified>Mon, 18 Jun 2001 11:00:04 GMT</lp0:getlastmodified>
<lp0:getetag>"3530002-1000-3b2ddf34"</lp0:getetag>
<D:supportedlock>
<D:lockentry>
<D:lockscope><D:exclusive/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
<D:lockentry>
<D:lockscope><D:shared/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
</D:supportedlock>
<D:lockdiscovery/>
<D:resourcetype><D:collection/></D:resourcetype>
<D:getcontenttype>httpd/unix-directory</D:getcontenttype>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>


207 Multi-Status
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/space1/2/d7055372/</D:href>
<D:propstat>
<D:prop>
<getlastmodified/>
</D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
</D:multistatus>

</output of davtest.py>



More information about the Python-list mailing list