def checkProperties(): addressbookProperties = (yield home.addressbookWithName(name)).properties() addressbookType = ResourceType.addressbook #@UndefinedVariable self.assertEquals( addressbookProperties[ PropertyName.fromString(ResourceType.sname()) ], addressbookType )
# draft-daboo-caldav-attachments # caldav_managed_attachments_compliance = ("calendar-managed-attachments", ) @registerElement class ManagedAttachmentsServerURL(CalDAVElement): """ Zero or one href elements defining the base scheme/host for attachments. """ name = "managed-attachments-server-URL" allowed_children = {(dav_namespace, "href"): (0, 1)} # # Extensions to ResourceType # def _isCalendar(self): return bool(self.childrenOfType(Calendar)) ResourceType.isCalendar = _isCalendar ResourceType.calendar = ResourceType(Collection(), Calendar()) ResourceType.scheduleInbox = ResourceType(Collection(), ScheduleInbox()) ResourceType.scheduleOutbox = ResourceType(Collection(), ScheduleOutbox())
name = "calendarserver-principal-search" allowed_children = { (calendarserver_namespace, "search-token"): (0, None), (calendarserver_namespace, "limit"): (0, 1), (dav_namespace, "prop"): (0, 1), (dav_namespace, "apply-to-principal-collection-set"): (0, 1), } allowed_attributes = {"context": False} ## # Extensions to ResourceType ## ResourceType.dropboxhome = ResourceType(Collection(), DropBoxHome()) ResourceType.dropbox = ResourceType(Collection(), DropBox()) ResourceType.calendarproxyread = ResourceType(Principal(), Collection(), CalendarProxyRead()) ResourceType.calendarproxywrite = ResourceType(Principal(), Collection(), CalendarProxyWrite()) ResourceType.calendarproxyreadfor = ResourceType(Principal(), Collection(), CalendarProxyReadFor()) ResourceType.calendarproxywritefor = ResourceType(Principal(), Collection(), CalendarProxyWriteFor()) ResourceType.timezones = ResourceType(Timezones()) ResourceType.ischeduleinbox = ResourceType(IScheduleInbox())
def addUnicodeChild(davFile): m = MetaDataMixin() m.contentType = lambda: MimeType.fromString('text/plain') m.resourceType = lambda: ResourceType() m.isCollection = lambda: False davFile.putChild(unicodeChildName, m)
class Directory(CardDAVEmptyElement): """ CardDAV property on a principal to indicate where the directory resource is. """ name = "directory" @registerElement class DefaultAddressBookURL(CardDAVElement): """ A single href indicating which addressbook is the default. """ name = "default-addressbook-URL" allowed_children = {(dav_namespace, "href"): (0, 1)} ## # Extensions to ResourceType ## def _isAddressBook(self): return bool(self.childrenOfType(AddressBook)) ResourceType.isAddressBook = _isAddressBook ResourceType.addressbook = ResourceType(Collection(), AddressBook()) ResourceType.directory = ResourceType(Collection(), AddressBook(), Directory())