def proppatch(path, xml_request, collection):
 root = ET.fromstring(xml_request.encode('utf8'))
 props_to_set = props_from_request(root, actions=('set',))
 props_to_remove = props_from_request(root, actions=('remove',))
 multistatus = ET.Element(_tag('D', 'multistatus'))
 response = ET.Element(_tag('D', 'response'))
 multistatus.append(response)
 href = ET.Element(_tag('D', 'href'))
 href.text = _href(collection, path)
 response.append(href)
 for short_name in props_to_remove:
  props_to_set[short_name] = ''
 collection.set_meta(props_to_set)
 for short_name in props_to_set:
  _add_propstat_to(response, short_name, 200)
 return _pretty_xml(multistatus)

def proppatch ( path , xml_request , collection ) : root = ET . fromstring ( xml_request . encode ( 'utf8' ) ) props_to_set = props_from_request ( root , actions = ( 'set' , ) ) props_to_remove = props_from_request ( root , actions = ( 'remove' , ) ) multistatus = ET . Element ( _tag ( 'D' , 'multistatus' ) ) response = ET . Element ( _tag ( 'D' , 'response' ) ) multistatus . append ( response ) href = ET . Element ( _tag ( 'D' , 'href' ) ) href . text = _href ( collection , path ) response . append ( href ) for short_name in props_to_remove : props_to_set [ short_name ] = '' collection . set_meta ( props_to_set ) for short_name in props_to_set : _add_propstat_to ( response , short_name , 200 ) return _pretty_xml ( multistatus )
read and answer proppatch requests .