Ejemplo n.º 1
0
 def readStandardProperties(self):
     """
     Read all WebDAV live properties.
     
     @return: A L{LiveProperties} instance which contains a getter method for each live property.
     """
     body = createFindBody(LiveProperties.NAMES, Constants.NS_DAV)
     response = self.connection.propfind(self.path, body, depth=0)
     properties = response.msr.values()[0]
     return LiveProperties(properties)
Ejemplo n.º 2
0
 def listResources(self):
     """
     Describe all members within this collection.
     
     @return: map from URI to a L{LiveProperties} instance containing the WebDAV
              live attributes of the contained resource
     """
     # *LiveProperties.NAMES denotes the list of all live properties as an
     # argument to the method call.
     response = self.connection.getprops(self.path,
                                         depth=1,
                                         ns=Constants.NS_DAV,
                                         *LiveProperties.NAMES)
     result = {}
     for path, properties in response.msr.items():
         if path == self.path:      # omit this collection resource
             continue
         ## some servers do not append a trailing slash to collection paths
         if self.path.endswith('/') and self.path[0:-1] == path:
             continue
         result[path] = LiveProperties(properties=properties)
     return result