Code Repositories xandikos / ba5d29f
Support refreshrate property. Jelmer Vernooń≥ 1 year, 8 months ago
3 changed file(s) with 43 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
245245 - DAV:calendar-proxy-read-for [supported]
246246 - DAV:calendar-proxy-write-for [supported]
247247
248 - {https://calendarserver.org/ns/}refreshrate
249
248250 Apple-specific Properties
249251 ^^^^^^^^^^^^^^^^^^^^^^^^^
250252
360360 def get_quota_available_bytes(self):
361361 # TODO(jelmer): Ask the store?
362362 raise KeyError
363
364 def get_refreshrate(self):
365 # TODO(jelmer): Support setting refreshrate
366 raise KeyError
367
368 def set_refreshrate(self, value):
369 # TODO(jelmer): Store refreshrate
370 raise NotImplementedError(self.set_refreshrate)
363371
364372
365373 class Collection(StoreBasedCollection, webdav.Collection):
855863 caldav.CalendarProxyWriteForProperty(),
856864 quota.QuotaAvailableBytesProperty(),
857865 quota.QuotaUsedBytesProperty(),
866 webdav.RefreshRateProperty(),
858867 ])
859868 self.register_reporters([
860869 caldav.CalendarMultiGetReporter(),
574574 name = '{http://calendarserver.org/ns/}getctag'
575575
576576
577 class RefreshRateProperty(Property):
578 """refreshrate property.
579
580 (no public documentation, but contains an ical-style frequency indicator)
581 """
582
583 name = '{http://calendarserver.org/ns/}refreshrate'
584 resource_type = COLLECTION_RESOURCE_TYPE
585 in_allprops = False
586
587 def get_value(self, href, resource, el, environ):
588 el.text = resource.get_refreshrate()
589
590 def set_value(self, href, resource, el):
591 resource.set_refreshrate(el.text)
592
593
577594 LOCK_SCOPE_EXCLUSIVE = '{DAV:}exclusive'
578595 LOCK_SCOPE_SHARED = '{DAV:}shared'
579596 LOCK_TYPE_WRITE = '{DAV:}write'
823840 """Destroy this collection itself.
824841 """
825842 raise NotImplementedError(self.destroy)
843
844 def set_refreshrate(self, value):
845 """Set the recommended refresh rate for this collection.
846
847 :param value: Refresh rate (None to remove)
848 """
849 raise NotImplementedError(self.set_refreshrate)
850
851 def get_refreshrate(self):
852 """Get the recommended refresh rate.
853
854 :return: Recommended refresh rate
855 :raise KeyError: if there is no refresh rate set
856 """
857 raise NotImplementedError(self.get_refreshrate)
826858
827859
828860 class Principal(Resource):