當前位置: 首頁>>代碼示例>>Python>>正文


Python resource.CalDAVResource類代碼示例

本文整理匯總了Python中twistedcaldav.resource.CalDAVResource的典型用法代碼示例。如果您正苦於以下問題:Python CalDAVResource類的具體用法?Python CalDAVResource怎麽用?Python CalDAVResource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CalDAVResource類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, principalCollections, principalDirectory, uri):

        CalDAVResource.__init__(self, principalCollections=principalCollections)

        self.principalDirectory = principalDirectory
        self.uri = uri
        self.directory = None
開發者ID:nunb,項目名稱:calendarserver,代碼行數:7,代碼來源:directorybackedaddressbook.py

示例2: __init__

 def __init__(self, principalCollections, isdir=False, defaultACL=authReadACL):
     """
     Make sure it is a collection.
     """
     CalDAVResource.__init__(self, principalCollections=principalCollections)
     DAVFile.__init__(self, NotFilePath(isfile=not isdir,isdir=isdir), principalCollections=principalCollections)
     self.defaultACL = defaultACL
開發者ID:svn2github,項目名稱:calendarserver-raw,代碼行數:7,代碼來源:simpleresource.py

示例3: __init__

    def __init__(self, parent, record):
        """
        @param path: the path to the file which will back the resource.
        """
        assert parent is not None
        assert record is not None

        CalDAVResource.__init__(self)

        self.record = record
        self.parent = parent

        # Cache children which must be of a specific type
        childlist = (
            ("inbox" , ScheduleInboxResource ),
            ("outbox", ScheduleOutboxResource),
        )
        if config.EnableDropBox:
            childlist += (
                ("dropbox", DropBoxHomeResource),
            )
        if config.FreeBusyURL.Enabled:
            childlist += (
                ("freebusy", FreeBusyURLResource),
            )
        if config.Sharing.Enabled and config.Sharing.Calendars.Enabled:
            childlist += (
                ("notification", NotificationCollectionResource),
            )
        for name, cls in childlist:
            child = self.provisionChild(name)
            # assert isinstance(child, cls), "Child %r is not a %s: %r" % (name, cls.__name__, child)
            self.putChild(name, child)
開發者ID:svn2github,項目名稱:calendarserver-raw,代碼行數:33,代碼來源:calendar.py

示例4: __init__

 def __init__(self, principalCollections, isdir=False, defaultACL=authReadACL):
     """
     Make sure it is a collection.
     """
     CalDAVResource.__init__(self, principalCollections=principalCollections)
     self._isDir = isdir
     self.defaultACL = defaultACL
開發者ID:anemitz,項目名稱:calendarserver,代碼行數:7,代碼來源:simpleresource.py

示例5: testComplianceClasses

    def testComplianceClasses(self):
        resource = CalDAVResource()

        config.EnableProxyPrincipals = True
        self.assertTrue("calendar-proxy" in resource.davComplianceClasses())

        config.EnableProxyPrincipals = False
        self.assertTrue("calendar-proxy" not in resource.davComplianceClasses())
開發者ID:svn2github,項目名稱:calendarserver-raw,代碼行數:8,代碼來源:test_config.py

示例6: __init__

    def __init__(self, parent):
        """
        @param parent: the parent resource of this one.
        """
        assert parent is not None

        CalDAVResource.__init__(self, principalCollections=parent.principalCollections())

        self.parent = parent
開發者ID:svn2github,項目名稱:calendarserver-raw,代碼行數:9,代碼來源:schedule.py

示例7: test_isOwnerUnauthenticated

 def test_isOwnerUnauthenticated(self):
     """
     L{CalDAVResource.isOwner} returns C{False} for unauthenticated requests.
     """
     site = None
     request = SimpleRequest(site, "GET", "/not/a/real/url/")
     request.authzUser = request.authnUser = None
     rsrc = CalDAVResource()
     rsrc.owner = lambda igreq: HRef("/somebody/")
     self.assertEquals((yield rsrc.isOwner(request)), False)
開發者ID:nunb,項目名稱:calendarserver,代碼行數:10,代碼來源:test_resource.py

示例8: test_isOwnerYes

 def test_isOwnerYes(self):
     """
     L{CalDAVResource.isOwner} returns C{True} for authenticated requests
     with a principal that matches the resource's owner.
     """
     site = None
     request = SimpleRequest(site, "GET", "/not/a/real/url/")
     request.authzUser = request.authnUser = StubPrincipal("/yes-i-am-the-owner/")
     rsrc = CalDAVResource()
     rsrc.owner = lambda igreq: HRef("/yes-i-am-the-owner/")
     self.assertEquals((yield rsrc.isOwner(request)), True)
開發者ID:nunb,項目名稱:calendarserver,代碼行數:11,代碼來源:test_resource.py

示例9: CalDAVResourceTests

class CalDAVResourceTests(TestCase):
    def setUp(self):
        TestCase.setUp(self)
        self.resource = CalDAVResource()
        self.resource._dead_properties = InMemoryPropertyStore()

    def test_writeDeadPropertyWritesProperty(self):
        prop = StubProperty()
        self.resource.writeDeadProperty(prop)
        self.assertEquals(self.resource._dead_properties.get(("StubQnamespace", "StubQname")),
                          prop)
開發者ID:svn2github,項目名稱:calendarserver-raw,代碼行數:11,代碼來源:test_resource.py

示例10: test_isOwnerReadPrincipal

 def test_isOwnerReadPrincipal(self):
     """
     L{CalDAVResource.isOwner} returns C{True} for authenticated requests
     with a principal that matches any principal configured in the
     L{AdminPrincipals} list.
     """
     theAdmin = "/read-only-admin/"
     self.patch(config, "ReadPrincipals", [theAdmin])
     site = None
     request = SimpleRequest(site, "GET", "/not/a/real/url/")
     request.authzUser = request.authnUser = StubPrincipal(theAdmin)
     rsrc = CalDAVResource()
     rsrc.owner = lambda igreq: HRef("/some-other-user/")
     self.assertEquals((yield rsrc.isOwner(request)), True)
開發者ID:nunb,項目名稱:calendarserver,代碼行數:14,代碼來源:test_resource.py

示例11: __init__

    def __init__(self, parent, record):
        """
        @param path: the path to the file which will back the resource.
        """
        assert parent is not None
        assert record is not None

        CalDAVResource.__init__(self)

        self.record = record
        self.parent = parent

        childlist = ()
        if config.Sharing.Enabled and config.Sharing.AddressBooks.Enabled and not config.Sharing.Calendars.Enabled:
            childlist += (
                ("notification", NotificationCollectionResource),
            )
        for name, cls in childlist:
            child = self.provisionChild(name)
            assert isinstance(child, cls), "Child %r is not a %s: %r" % (name, cls.__name__, child)
            self.putChild(name, child)
開發者ID:svn2github,項目名稱:calendarserver-raw,代碼行數:21,代碼來源:addressbook.py

示例12: testComplianceClasses

    def testComplianceClasses(self):
        resource = CalDAVResource()

        config.EnableProxyPrincipals = True
        self.assertTrue("calendar-proxy" in resource.davComplianceClasses())

        config.EnableProxyPrincipals = False
        self.assertTrue("calendar-proxy" not in resource.davComplianceClasses())

        self.assertTrue("calendarserver-group-sharee" in resource.davComplianceClasses())
        config.Sharing.Calendars.Groups.Enabled = False
        config.update()
        self.assertTrue("calendarserver-group-sharee" not in resource.davComplianceClasses())
        config.Sharing.Calendars.Groups.Enabled = True
        config.update()

        self.assertTrue("calendarserver-group-attendee" in resource.davComplianceClasses())
        config.GroupAttendees.Enabled = False
        config.update()
        self.assertTrue("calendarserver-group-attendee" not in resource.davComplianceClasses())
        config.GroupAttendees.Enabled = True
        config.update()
開發者ID:eventable,項目名稱:CalendarServer,代碼行數:22,代碼來源:test_config.py

示例13: __init__

    def __init__(self, principalCollections, uri):

        CalDAVResource.__init__(self, principalCollections=principalCollections)

        self.uri = uri
        self.directory = None  # creates directory attribute
開發者ID:svn2github,項目名稱:calendarserver-raw,代碼行數:6,代碼來源:directorybackedaddressbook.py

示例14: __init__

 def __init__(self, parent):
     self._parent = parent
     CalDAVResource.__init__(self)
開發者ID:eventable,項目名稱:CalendarServer,代碼行數:3,代碼來源:notifications.py

示例15: setUp

 def setUp(self):
     TestCase.setUp(self)
     self.resource = CalDAVResource()
     self.resource._dead_properties = InMemoryPropertyStore()
開發者ID:nunb,項目名稱:calendarserver,代碼行數:4,代碼來源:test_resource.py


注:本文中的twistedcaldav.resource.CalDAVResource類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。