Esempio n. 1
0
 def writeProperties(self, properties, lockToken=None):
     """
     Sets or updates the given properties.
     
     @param lockToken: if the resource has been locked this is the lock token.
     @type  lockToken: L{LockToken}
     @param properties: a map from property names to a String or
                        DOM element value for each property to add or update.
     """
     assert isinstance(properties, types.DictType)
     assert lockToken == None or isinstance(lockToken, LockToken), \
             "Invalid lockToken argument %s" % type(lockToken)
     header = {}
     if lockToken:
         header = lockToken.toHeader()
     body = createUpdateBody(properties, self.defaultNamespace)
     response = self.connection.proppatch(self.path, body, header)
     if  response.msr.errorCount > 0:
         raise WebdavError("Request failed: " + response.msr.reason, response.msr.code)
Esempio n. 2
0
    def writeProperties(self, properties, lockToken=None):
        """
        Sets or updates the given properties.

        @param lockToken: if the resource has been locked this is the lock token.
        @type  lockToken: L{LockToken}
        @param properties: a map from property names to a String or
                           DOM element value for each property to add or update.
        """
        assert isinstance(properties, types.DictType)
        assert lockToken == None or isinstance(lockToken, LockToken), \
                "Invalid lockToken argument %s" % type(lockToken)
        header = {}
        if lockToken:
            header = lockToken.toHeader()
        body = createUpdateBody(properties, self.defaultNamespace)
        response = self.connection.proppatch(self.path, body, header)
        if  response.msr.errorCount > 0:
            raise WebdavError("Request failed: " + response.msr.reason, response.msr.code)