Code Repositories xandikos / 16e9a96
Add an environ argument to get_value(). Jelmer Vernooń≥ 2 years ago
14 changed file(s) with 119 addition(s) and 103 deletion(s). Raw diff Collapse all Expand all
3333 Roadmap
3434 =======
3535
36 * Allow marking collections as principals
3637 * Expose username (or None, if not logged in) everywhere
3738 * Add function get_username_principal() for mapping username to principal path
3839 * Add simple function check_path_access() for checking access ("is this user allowed to access this path?")
3939 in_allprops = False
4040 live = True
4141
42 def get_value(self, href, resource, el):
42 def get_value(self, href, resource, el, environ):
4343 privilege = ET.SubElement(el, '{DAV:}privilege')
4444 # TODO(jelmer): Use something other than all
4545 ET.SubElement(privilege, '{DAV:}all')
5555 in_allprops = False
5656 live = True
5757
58 def get_value(self, base_href, resource, el):
58 def get_value(self, base_href, resource, el, environ):
5959 owner_href = resource.get_owner()
6060 if owner_href is not None:
6161 el.append(webdav.create_href(owner_href, base_href=base_href))
7272 live = True
7373 resource_type = webdav.PRINCIPAL_RESOURCE_TYPE
7474
75 def get_value(self, base_href, resource, el):
75 def get_value(self, base_href, resource, el, environ):
7676 for href in resource.get_group_membership():
7777 el.append(webdav.create_href(href, base_href=href))
3333 resource_type = None
3434 live = False
3535
36 def get_value(self, href, resource, el):
36 def get_value(self, href, resource, el, environ):
3737 el.text = ('T' if resource.get_is_executable() else 'F')
3838
3939 def set_value(self, href, resource, el):
141141 in_allprops = False
142142 live = True
143143
144 def get_value(self, base_href, resource, el):
144 def get_value(self, base_href, resource, el, environ):
145145 for href in resource.get_calendar_home_set():
146146 href = webdav.ensure_trailing_slash(href)
147147 el.append(webdav.create_href(href, base_href))
156156 name = '{urn:ietf:params:xml:ns:caldav}calendar-description'
157157 resource_type = CALENDAR_RESOURCE_TYPE
158158
159 def get_value(self, base_href, resource, el):
159 def get_value(self, base_href, resource, el, environ):
160160 el.text = resource.get_calendar_description()
161161
162162 # TODO(jelmer): allow modification of this property
200200 def supported_on(self, resource):
201201 return (resource.get_content_type() == 'text/calendar')
202202
203 def get_value_ext(self, base_href, resource, el, requested):
203 def get_value_ext(self, base_href, resource, el, environ, requested):
204204 if len(requested) == 0:
205205 serialized_cal = b''.join(resource.get_body())
206206 else:
539539 if not apply_filter(filter_el, resource, tzify):
540540 continue
541541 propstat = davcommon.get_properties_with_data(
542 self.data_property, href, resource, properties, requested)
542 self.data_property, href, resource, properties, environ,
543 requested)
543544 yield webdav.Status(href, '200 OK', propstat=list(propstat))
544545
545546
552553 name = '{http://apple.com/ns/ical/}calendar-color'
553554 resource_type = CALENDAR_RESOURCE_TYPE
554555
555 def get_value(self, href, resource, el):
556 def get_value(self, href, resource, el, environ):
556557 el.text = resource.get_calendar_color()
557558
558559 def set_value(self, href, resource, el):
572573 in_allprops = False
573574 live = True
574575
575 def get_value(self, href, resource, el):
576 def get_value(self, href, resource, el, environ):
576577 for component in resource.get_supported_calendar_components():
577578 subel = ET.SubElement(el, '{urn:ietf:params:xml:ns:caldav}comp')
578579 subel.set('name', component)
588589 resource_type = CALENDAR_RESOURCE_TYPE
589590 in_allprops = False
590591
591 def get_value(self, href, resource, el):
592 def get_value(self, href, resource, el, environ):
592593 for (content_type, version) in (
593594 resource.get_supported_calendar_data_types()):
594595 subel = ET.SubElement(
607608 resource_type = CALENDAR_RESOURCE_TYPE
608609 in_allprops = False
609610
610 def get_value(self, href, resource, el):
611 def get_value(self, href, resource, el, environ):
611612 el.text = resource.get_calendar_timezone()
612613
613614 def set_value(self, href, resource, el):
628629 in_allprops = False
629630 live = True
630631
631 def get_value(self, href, resource, el):
632 def get_value(self, href, resource, el, environ):
632633 el.text = resource.get_min_date_time()
633634
634635
643644 in_allprops = False
644645 live = True
645646
646 def get_value(self, href, resource, el):
647 def get_value(self, href, resource, el, environ):
647648 el.text = resource.get_max_date_time()
648649
649650
658659 in_allprops = False
659660 live = True
660661
661 def get_value(self, href, resource, el):
662 def get_value(self, href, resource, el, environ):
662663 el.text = str(resource.get_max_instances())
663664
664665
673674 in_allprops = False
674675 live = True
675676
676 def get_value(self, href, resource, el):
677 def get_value(self, href, resource, el, environ):
677678 el.text = str(resource.get_max_attendees_per_instance())
678679
679680
689690 in_allprops = False
690691 live = True
691692
692 def get_value(self, base_href, resource, el):
693 def get_value(self, base_href, resource, el, environ):
693694 for href in resource.get_calendar_proxy_read_for():
694695 el.append(webdav.create_href(href, base_href))
695696
706707 in_allprops = False
707708 live = True
708709
709 def get_value(self, base_href, resource, el):
710 def get_value(self, base_href, resource, el, environ):
710711 for href in resource.get_calendar_proxy_write_for():
711712 el.append(webdav.create_href(href, base_href))
712713
820821 start_response('409 Conflict', [])
821822 return []
822823 el = ET.Element('{DAV:}resourcetype')
823 app.properties['{DAV:}resourcetype'].get_value(href, resource, el)
824 app.properties['{DAV:}resourcetype'].get_value(
825 href, resource, el, environ)
824826 ET.SubElement(el, '{urn:ietf:params:xml:ns:caldav}calendar')
825827 app.properties['{DAV:}resourcetype'].set_value(href, resource, el)
826828 if base_content_type in ('text/xml', 'application/xml'):
4444 in_allprops = False
4545 live = True
4646
47 def get_value(self, base_href, resource, el):
47 def get_value(self, base_href, resource, el, environ):
4848 for href in resource.get_addressbook_home_set():
4949 href = webdav.ensure_trailing_slash(href)
5050 el.append(webdav.create_href(href, base_href))
6464 def supported_on(self, resource):
6565 return (resource.get_content_type() == 'text/vcard')
6666
67 def get_value_ext(self, href, resource, el, requested):
67 def get_value_ext(self, href, resource, el, environ, requested):
6868 # TODO(jelmer): Support subproperties
6969 # TODO(jelmer): Don't hardcode encoding
7070 el.text = b''.join(resource.get_body()).decode('utf-8')
7979 name = '{%s}addressbook-description' % NAMESPACE
8080 resource_type = ADDRESSBOOK_RESOURCE_TYPE
8181
82 def get_value(self, href, resource, el):
82 def get_value(self, href, resource, el, environ):
8383 el.text = resource.get_addressbook_description()
8484
8585 def set_value(self, href, resource, el):
157157 resource_type = '{DAV:}principal'
158158 in_allprops = False
159159
160 def get_value(self, href, resource, el):
160 def get_value(self, href, resource, el, environ):
161161 el.append(webdav.create_href(
162162 resource.get_principal_address(), href))
163163
173173 in_allprops = False
174174 live = True
175175
176 def get_value(self, href, resource, el):
176 def get_value(self, href, resource, el, environ):
177177 for (content_type,
178178 version) in resource.get_supported_address_data_types():
179179 subel = ET.SubElement(el, '{%s}content-type' % NAMESPACE)
192192 in_allprops = False
193193 live = True
194194
195 def get_value(self, href, resource, el):
195 def get_value(self, href, resource, el, environ):
196196 el.text = str(resource.get_max_resource_size())
197197
198198
207207 in_allprops = False
208208 live = True
209209
210 def get_value(self, href, resource, el):
210 def get_value(self, href, resource, el, environ):
211211 el.text = str(resource.get_max_image_size())
212212
213213
345345 if nresults is not None and i >= nresults:
346346 break
347347 propstat = davcommon.get_properties_with_data(
348 self.data_property, href, resource, properties, requested)
348 self.data_property, href, resource, properties, environ,
349 requested)
349350 yield webdav.Status(href, '200 OK', propstat=list(propstat))
350351 i += 1
2626 class SubbedProperty(webdav.Property):
2727 """Property with sub-components that can be queried."""
2828
29 def get_value_ext(self, href, resource, el, requested):
29 def get_value_ext(self, href, resource, el, environ, requested):
3030 """Get the value of a data property.
3131
3232 :param href: Resource href
3333 :param resource: Resource to get value for
3434 :param el: Element to fill in
35 :param environ: WSGI environ dict
3536 :param requested: Requested property (including subelements)
3637 """
3738 raise NotImplementedError(self.get_value_ext)
3839
3940
4041 def get_properties_with_data(data_property, href, resource, properties,
41 requested):
42 environ, requested):
4243 properties = dict(properties)
4344 properties[data_property.name] = data_property
44 return webdav.get_properties(href, resource, properties, requested)
45 return webdav.get_properties(
46 href, resource, properties, environ, requested)
4547
4648
4749 class MultiGetReporter(webdav.Reporter):
7274 yield webdav.Status(href, '404 Not Found', propstat=[])
7375 else:
7476 propstat = get_properties_with_data(
75 self.data_property, href, resource, properties, requested)
77 self.data_property, href, resource, properties, environ,
78 requested)
7679 yield webdav.Status(href, '200 OK', propstat=list(propstat))
7780
7881
3131 resource_type = webdav.PRINCIPAL_RESOURCE_TYPE
3232 live = False
3333
34 def get_value(self, href, resource, el):
34 def get_value(self, href, resource, el, environ):
3535 el.text = resource.get_infit_settings()
3636
3737 def set_value(self, href, resource, el):
4848 resource_type = carddav.ADDRESSBOOK_RESOURCE_TYPE
4949 in_allprops = False
5050
51 def get_value(self, href, resource, el):
51 def get_value(self, href, resource, el, environ):
5252 el.text = resource.get_addressbook_color()
5353
5454 def set_value(self, href, resource, el):
6666 in_allprops = False
6767 live = False
6868
69 def get_value(self, href, resource, el):
69 def get_value(self, href, resource, el, environ):
7070 el.text = resource.get_headervalue()
7171
7272 def set_value(self, href, resource, el):
3232 in_allprops = False
3333 live = True
3434
35 def get_value(self, href, resource, el):
35 def get_value(self, href, resource, el, environ):
3636 el.text = resource.get_quota_available_bytes()
3737
3838
4545 in_allprops = False
4646 live = True
4747
48 def get_value(self, href, resource, el):
48 def get_value(self, href, resource, el, environ):
4949 el.text = resource.get_quota_used_bytes()
6969 resource_type = caldav.CALENDAR_RESOURCE_TYPE
7070 in_allprops = True
7171
72 def get_value(self, href, resource, el):
72 def get_value(self, href, resource, el, environ):
7373 el.append(webdav.create_href(resource.get_schedule_inbox_url(), href))
7474
7575
8383 resource_type = caldav.CALENDAR_RESOURCE_TYPE
8484 in_allprops = True
8585
86 def get_value(self, href, resource, el):
86 def get_value(self, href, resource, el, environ):
8787 el.append(webdav.create_href(resource.get_schedule_outbox_url(), href))
8888
8989
9797 resource_type = webdav.PRINCIPAL_RESOURCE_TYPE
9898 in_allprops = False
9999
100 def get_value(self, base_href, resource, el):
100 def get_value(self, base_href, resource, el, environ):
101101 for href in resource.get_calendar_user_address_set():
102102 el.append(webdav.create_href(href, base_href))
103103
112112 resource_type = webdav.PRINCIPAL_RESOURCE_TYPE
113113 in_allprops = False
114114
115 def get_value(self, href, resource, el):
115 def get_value(self, href, resource, el, environ):
116116 el.text = resource.get_calendar_user_type()
106106 for prop in requested:
107107 if old_resource is not None:
108108 old_propstat = webdav.get_property_from_element(
109 href, old_resource, properties, prop)
109 href, old_resource, properties, prop, environ)
110110 else:
111111 old_propstat = None
112112 new_propstat = webdav.get_property_from_element(
113 href, new_resource, properties, prop)
113 href, new_resource, properties, prop, environ)
114114 if old_propstat != new_propstat:
115115 propstat.append(new_propstat)
116116 yield webdav.Status(
130130 in_allprops = False
131131 live = True
132132
133 def get_value(self, href, resource, el):
133 def get_value(self, href, resource, el, environ):
134134 el.text = resource.get_sync_token()
5555 class ResourceTypeProperty(Property):
5656 name = '{DAV:}resourcetype'
5757
58 def get_value(unused_self, href, resource, ret):
58 def get_value(unused_self, href, resource, ret, environ):
5959 ET.SubElement(ret, '{DAV:}collection')
6060
6161 def set_value(unused_self, href, resource, ret):
248248 class TestProperty(Property):
249249 name = '{DAV:}current-user-principal'
250250
251 def get_value(self, href, resource, ret):
251 def get_value(self, href, resource, ret, environ):
252252 raise KeyError
253253 app = self.makeApp({'/resource': Resource()}, [TestProperty()])
254254 code, headers, contents = self.propfind(app, '/resource', b"""\
266266 class TestProperty(Property):
267267 name = '{DAV:}current-user-principal'
268268
269 def get_value(self, href, resource, ret):
269 def get_value(self, href, resource, ret, environ):
270270 ET.SubElement(ret, '{DAV:}href').text = '/user/'
271271 app = self.makeApp({'/resource': Resource()}, [TestProperty()])
272272 code, headers, contents = self.propfind(app, '/resource', b"""\
286286 class TestProperty1(Property):
287287 name = '{DAV:}current-user-principal'
288288
289 def get_value(self, href, resource, el):
289 def get_value(self, href, resource, el, environ):
290290 ET.SubElement(el, '{DAV:}href').text = '/user/'
291291
292292 class TestProperty2(Property):
293293 name = '{DAV:}somethingelse'
294294
295 def get_value(self, href, resource, el):
295 def get_value(self, href, resource, el, environ):
296296 pass
297297 app = self.makeApp(
298298 {'/resource': Resource()},
316316 class TestProperty(Property):
317317 name = '{DAV:}current-user-principal'
318318
319 def get_value(self, href, resource, ret):
319 def get_value(self, href, resource, ret, environ):
320320 ET.SubElement(ret, '{DAV:}href').text = '/user/'
321321 app = self.makeApp({'/resource': Resource()}, [TestProperty()])
322322 code, headers, contents = self.propfind(app, '/resource', b"""\
4141 super(TimezoneServiceSetProperty, self).__init__()
4242 self._timezone_services = timezone_services
4343
44 def get_value(self, base_href, resource, el):
44 def get_value(self, base_href, resource, el, environ):
4545 for timezone_service_href in self._timezone_services:
4646 el.append(webdav.create_href(timezone_service_href, base_href))
295295 return (self.resource_type is None or
296296 self.resource_type in resource.resource_types)
297297
298 def is_set(self, href, resource):
298 def is_set(self, href, resource, environ):
299299 """Check if this property is set on a resource."""
300300 if not self.supported_on(resource):
301301 return False
302302 try:
303 self.get_value('/', resource, ET.Element(self.name))
303 self.get_value('/', resource, ET.Element(self.name), environ)
304304 except KeyError:
305305 return False
306306 else:
307307 return True
308308
309 def get_value(self, href, resource, el):
309 def get_value(self, href, resource, el, environ):
310310 """Get property with specified name.
311311
312312 :param href: Resource href
313313 :param resource: Resource for which to retrieve the property
314314 :param el: Element to populate
315 :param environ: WSGI environment dict
315316 :raise KeyError: if this property is not present
316317 """
317318 raise KeyError(self.name)
337338
338339 live = True
339340
340 def get_value(self, href, resource, el):
341 def get_value(self, href, resource, el, environ):
341342 for rt in resource.resource_types:
342343 ET.SubElement(el, rt)
343344
354355 name = '{DAV:}displayname'
355356 resource_type = None
356357
357 def get_value(self, href, resource, el):
358 def get_value(self, href, resource, el, environ):
358359 el.text = resource.get_displayname()
359360
360361 def set_value(self, href, resource, el):
371372 resource_type = None
372373 live = True
373374
374 def get_value(self, href, resource, el):
375 def get_value(self, href, resource, el, environ):
375376 el.text = resource.get_etag()
376377
377378
385386 resource_type = COLLECTION_RESOURCE_TYPE
386387 live = True
387388
388 def get_value(self, href, resource, el):
389 def get_value(self, href, resource, el, environ):
389390 # Support POST against collection URL
390391 el.append(create_href('.', href))
391392
401402 live = True
402403 in_allprops = True
403404
404 def get_value(self, href, resource, el):
405 def get_value(self, href, resource, el, environ):
405406 # Use rfc1123 date (section 3.3.1 of RFC2616)
406407 el.text = resource.get_last_modified().strftime(
407408 '%a, %d %b %Y %H:%M:%S GMT')
429430 resource_type = None
430431 live = True
431432
432 def get_value(self, href, resource, el):
433 def get_value(self, href, resource, el, environ):
433434 el.text = format_datetime(resource.get_creationdate())
434435
435436
442443 name = '{DAV:}getcontentlanguage'
443444 resource_type = None
444445
445 def get_value(self, href, resource, el):
446 def get_value(self, href, resource, el, environ):
446447 el.text = ', '.join(resource.get_content_language())
447448
448449
455456 name = '{DAV:}getcontentlength'
456457 resource_type = None
457458
458 def get_value(self, href, resource, el):
459 def get_value(self, href, resource, el, environ):
459460 el.text = str(resource.get_content_length())
460461
461462
468469 name = '{DAV:}getcontenttype'
469470 resource_type = None
470471
471 def get_value(self, href, resource, el):
472 def get_value(self, href, resource, el, environ):
472473 el.text = resource.get_content_type()
473474
474475
488489 self.current_user_principal = ensure_trailing_slash(
489490 current_user_principal)
490491
491 def get_value(self, href, resource, el):
492 def get_value(self, href, resource, el, environ):
492493 """Get property with specified name.
493494
494495 :param name: A property name.
508509 in_allprops = True
509510 live = True
510511
511 def get_value(self, href, resource, el):
512 def get_value(self, href, resource, el, environ):
512513 """Get property with specified name.
513514
514515 :param name: A property name.
527528 def __init__(self, reporters):
528529 self._reporters = reporters
529530
530 def get_value(self, href, resource, el):
531 def get_value(self, href, resource, el, environ):
531532 for name, reporter in self._reporters.items():
532533 if reporter.supported_on(resource):
533534 bel = ET.SubElement(el, '{DAV:}supported-report')
544545 in_allprops = False
545546 live = True
546547
547 def get_value(self, href, resource, el):
548 def get_value(self, href, resource, el, environ):
548549 el.text = resource.get_ctag()
549550
550551
855856 raise NotImplementedError(self.get_calendar_proxy_write_for)
856857
857858
858 def get_property_from_name(href, resource, properties, name):
859 def get_property_from_name(href, resource, properties, name, environ):
859860 """Get a single property on a resource.
860861
861862 :param href: Resource href
862863 :param resource: Resource object
863864 :param properties: Dictionary of properties
865 :param environ: WSGI environ dict
864866 :param name: name of property to resolve
865867 :return: PropStatus items
866868 """
867869 return get_property_from_element(
868 href, resource, properties, ET.Element(name))
869
870
871 def get_property_from_element(href, resource, properties, requested):
870 href, resource, properties, environ, ET.Element(name))
871
872
873 def get_property_from_element(href, resource, properties, environ, requested):
872874 """Get a single property on a resource.
873875
874876 :param href: Resource href
875877 :param resource: Resource object
876878 :param properties: Dictionary of properties
879 :param environ: WSGI environ dict
877880 :param requested: Requested element
878881 :return: PropStatus items
879882 """
893896 try:
894897 get_value_ext = prop.get_value_ext
895898 except AttributeError:
896 prop.get_value(href, resource, ret)
899 prop.get_value(href, resource, ret, environ)
897900 else:
898 get_value_ext(href, resource, ret, requested)
901 get_value_ext(href, resource, ret, environ, requested)
899902 except KeyError:
900903 statuscode = '404 Not Found'
901904 else:
903906 return PropStatus(statuscode, responsedescription, ret)
904907
905908
906 def get_properties(href, resource, properties, requested):
909 def get_properties(href, resource, properties, environ, requested):
907910 """Get a set of properties.
908911
909912 :param href: Resource Href
910913 :param resource: Resource object
911914 :param properties: Dictionary of properties
912915 :param requested: XML {DAV:}prop element with properties to look up
916 :param environ: WSGI environ dict
913917 :return: Iterator over PropStatus items
914918 """
915919 for propreq in list(requested):
916 yield get_property_from_element(href, resource, properties, propreq)
917
918
919 def get_property_names(href, resource, properties, requested):
920 yield get_property_from_element(
921 href, resource, properties, environ, propreq)
922
923
924 def get_property_names(href, resource, properties, environ, requested):
920925 """Get a set of property names.
926
927 :param href: Resource Href
928 :param resource: Resource object
929 :param properties: Dictionary of properties
930 :param environ: WSGI environ dict
931 :param requested: XML {DAV:}prop element with properties to look up
932 :return: Iterator over PropStatus items
933 """
934 for name, prop in properties.items():
935 if prop.is_set(href, resource, environ):
936 yield PropStatus('200 OK', None, ET.Element(name))
937
938
939 def get_all_properties(href, resource, properties, environ):
940 """Get all properties.
921941
922942 :param href: Resource Href
923943 :param resource: Resource object
924944 :param properties: Dictionary of properties
925945 :param requested: XML {DAV:}prop element with properties to look up
946 :param environ: WSGI environ dict
926947 :return: Iterator over PropStatus items
927948 """
928 for name, prop in properties.items():
929 if prop.is_set(href, resource):
930 yield PropStatus('200 OK', None, ET.Element(name))
931
932
933 def get_all_properties(href, resource, properties):
934 """Get all properties.
935
936 :param href: Resource Href
937 :param resource: Resource object
938 :param properties: Dictionary of properties
939 :param requested: XML {DAV:}prop element with properties to look up
940 :return: Iterator over PropStatus items
941 """
942949 for name in properties:
943 ps = get_property_from_name(href, resource, properties, name)
950 ps = get_property_from_name(href, resource, properties, name, environ)
944951 if ps.statuscode == '200 OK':
945952 yield ps
946953
10431050 name = '{DAV:}expand-property'
10441051
10451052 def _populate(self, prop_list, resources_by_hrefs, properties, href,
1046 resource):
1053 resource, environ):
10471054 """Expand properties for a resource.
10481055
10491056 :param prop_list: DAV:property elements to retrieve and expand
10511058 :param properties: Available properties
10521059 :param href: href for current resource
10531060 :param resource: current resource
1061 :param environ: WSGI environ dict
10541062 :return: Status object
10551063 """
10561064 ret = []
10581066 prop_name = prop.get('name')
10591067 # FIXME: Resolve prop_name on resource
10601068 propstat = get_property_from_name(
1061 href, resource, properties, prop_name)
1069 href, resource, properties, prop_name, environ)
10621070 new_prop = ET.Element(propstat.prop.tag)
10631071 child_hrefs = [
10641072 read_href_element(prop_child)
10771085 new_prop.append(prop_child)
10781086 else:
10791087 response = self._populate(
1080 prop, properties, child_href, child_resource)
1088 prop, properties, child_href, child_resource,
1089 environ)
10811090 new_prop.append(response.aselement())
10821091 propstat = PropStatus(propstat.statuscode,
10831092 propstat.responsedescription, prop=new_prop)
10881097 def report(self, environ, request_body, resources_by_hrefs, properties,
10891098 href, resource, depth):
10901099 return self._populate(request_body, resources_by_hrefs, properties,
1091 href, resource)
1100 href, resource, environ)
10921101
10931102
10941103 class SupportedLockProperty(Property):
11011110 resource_type = None
11021111 live = True
11031112
1104 def get_value(self, href, resource, el):
1113 def get_value(self, href, resource, el, environ):
11051114 for (lockscope, locktype) in resource.get_supported_locks():
11061115 entry = ET.SubElement(el, '{DAV:}lockentry')
11071116 scope_el = ET.SubElement(entry, '{DAV:}lockscope')
11201129 resource_type = None
11211130 live = True
11221131
1123 def get_value(self, href, resource, el):
1132 def get_value(self, href, resource, el, environ):
11241133 for activelock in resource.get_active_locks():
11251134 entry = ET.SubElement(el, '{DAV:}activelock')
11261135 type_el = ET.SubElement(entry, '{DAV:}locktype')
11491158 live = False
11501159 in_allprops = False
11511160
1152 def get_value(self, href, resource, el):
1161 def get_value(self, href, resource, el, environ):
11531162 el.text = resource.get_comment()
11541163
11551164 def set_value(self, href, resource, el):
14891498 propstat = []
14901499 if requested is None or requested.tag == '{DAV:}allprop':
14911500 propstat = get_all_properties(
1492 href, resource, app.properties)
1501 href, resource, app.properties, environ)
14931502 elif requested.tag == '{DAV:}prop':
14941503 propstat = get_properties(
1495 href, resource, app.properties, requested)
1504 href, resource, app.properties, environ, requested)
14961505 elif requested.tag == '{DAV:}propname':
14971506 propstat = get_property_names(
1498 href, resource, app.properties, requested)
1507 href, resource, app.properties, environ, requested)
14991508 else:
15001509 raise BadRequestError(
15011510 'Expected prop/allprop/propname tag, got ' + requested.tag)