Code Repositories xandikos / 6033119
Add support for max-attachments-per-resource and max-attachment-size properties. Jelmer Vernooń≥ 1 year, 11 months ago
3 changed file(s) with 48 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
258258 - settings [supported]
259259 - addressbook-color [supported]
260260
261 AgendaV properties
262 ^^^^^^^^^^^^^^^^^^
263
264 - CALDAV:max-attachments-per-resource
265 - CALDAV:max-attachment-size
266
261267 rfc5995.txt (POST to create members)
262268 ------------------------------------
263269
121121 def get_max_resource_size(self):
122122 """Return max resource size."""
123123 raise NotImplementedError(self.get_max_resource_size)
124
125 def get_max_attachments_per_resource(self):
126 """Return max attachments per resource."""
127 raise NotImplementedError(self.get_max_attachments_per_resource)
128
129 def get_max_attachment_size(self):
130 """Return max attachment size."""
131 raise NotImplementedError(self.get_max_attachment_size)
124132
125133 def get_schedule_calendar_transparency(self):
126134 """Get calendar transparency.
723731
724732 def get_value(self, href, resource, el, environ):
725733 el.text = str(resource.get_max_resource_size())
734
735
736 class MaxAttachmentsPerResourceProperty(webdav.Property):
737 """max-attachments-per-resource property.
738 """
739
740 name = '{%s}max-attachments-per-resource' % NAMESPACE
741 resource_type = CALENDAR_RESOURCE_TYPE
742 in_allprops = False
743 live = True
744
745 def get_value(self, href, resource, el, environ):
746 el.text = str(resource.get_max_attachments_per_resource())
747
748
749 class MaxAttachmentSizeProperty(webdav.Property):
750 """max-attachment-size property.
751 """
752
753 name = '{%s}max-attachment-size' % NAMESPACE
754 resource_type = CALENDAR_RESOURCE_TYPE
755 in_allprops = False
756 live = True
757
758 def get_value(self, href, resource, el, environ):
759 el.text = str(resource.get_max_attachment_size())
726760
727761
728762 class CalendarProxyReadForProperty(webdav.Property):
401401 raise KeyError
402402
403403 def get_max_resource_size(self):
404 # No resource limit
405 raise KeyError
406
407 def get_max_attachments_per_resource(self):
408 # No resource limit
409 raise KeyError
410
411 def get_max_attachment_size(self):
404412 # No resource limit
405413 raise KeyError
406414