Code Repositories xandikos / bedd698
Support (but ignore) headervalue property. Jelmer Vernooń≥ 3 years ago
4 changed file(s) with 30 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
187187 - getctag [supported]
188188
189189 ## inf-it properties
190 - headervalue [not supported]
190 - headervalue [supported]
191191 - settings [supported]
192192 - addressbook-color [supported]
2727 class SettingsProperty(webdav.Property):
2828 """settings propety.
2929
30 JSON settings.
3031 """
3132
3233 name = '{http://inf-it.com/ns/dav/}settings'
4344 class AddressbookColorProperty(webdav.Property):
4445 """Provides the addressbook-color property.
4546
46 This is an inf-it extension.
47 Contains a RRGGBB code, similar to calendar-color.
4748 """
4849
4950 name = '{http://inf-it.com/ns/ab/}addressbook-color'
5354
5455 def get_value(self, resource, el):
5556 el.text = resource.get_addressbook_color()
57
58
59 class HeaderValueProperty(webdav.Property):
60 """Provides the header-value property.
61
62 This behaves similar to the hrefLabel setting in caldavzap/carddavmate.
63 """
64
65
66 name = '{http://inf-it.com/ns/ab/}headervalue'
67 resource_type = webdav.COLLECTION_RESOURCE_TYPE
68 in_allprops = False
69 protected = False
70
71 def get_value(self, resource, el):
72 el.text = resource.get_headervalue()
180180 def get_active_locks(self):
181181 return []
182182
183 def get_headervalue(self):
184 raise KeyError
185
183186
184187 class Collection(StoreBasedCollection,caldav.Calendar):
185188 """A generic WebDAV collection."""
306309 if not os.path.isdir(p):
307310 raise KeyError(name)
308311 return self.backend.get_resource(relpath)
312
313 def get_headervalue(self):
314 raise KeyError
309315
310316
311317 class RootPage(webdav.Resource):
449455 webdav.SupportedLockProperty(),
450456 webdav.LockDiscoveryProperty(),
451457 infit.AddressbookColorProperty(),
452 infit.SettingsProperty()
458 infit.SettingsProperty(),
459 infit.HeaderValueProperty(),
453460 ])
454461 self.register_reporters([
455462 caldav.CalendarMultiGetReporter(),
477477
478478 def get_ctag(self):
479479 raise NotImplementedError(self.getctag)
480
481 def get_headervalue(self):
482 raise NotImplementedError(self.get_headervalue)
480483
481484
482485 class Principal(Resource):