예제 #1
0
    def getPrincipal(self, path=None, refresh=False):
        if path:
            return principalCache.getPrincipal(self.session, path, refresh=refresh)
        elif refresh:
            self.principal = principalCache.getPrincipal(self.session, self.session.principalPath, refresh=refresh)

        return self.principal
예제 #2
0
    def getPrincipal(self, path=None, refresh=False):
        if path:
            return principalCache.getPrincipal(self.session, path, refresh=refresh)
        elif refresh:
            self.principal = principalCache.getPrincipal(self.session, self.session.principalPath, refresh=refresh)

        return self.principal
예제 #3
0
    def ensureSharees(self, session, calendarhref, n):
        """
        Make sure the required number of sharees are present in the calendar.

        @param n: number of sharees
        @type n: C{int}
        """

        users = []
        uids = []
        for i in range(n - self.currentCount):
            index = self.currentCount + i + 2
            users.append("user%02d" % (index, ))
            uids.append("urn:x-uid:10000000-0000-0000-0000-000000000%03d" %
                        (index, ))
        session.addInvitees(URL(path=calendarhref), uids, True)

        # Now accept each one
        for user in users:
            acceptor = SQLUsageSession(self.server,
                                       self.port,
                                       user=user,
                                       pswd=user,
                                       root="/",
                                       calendar="shared")
            notifications = acceptor.getNotifications(
                URL(path=acceptor.notificationHref))
            principal = principalCache.getPrincipal(acceptor,
                                                    acceptor.principalPath)
            acceptor.processNotification(principal, notifications[0], True)

        self.currentCount = n
예제 #4
0
    def ensureSharees(self, session, calendarhref, n):
        """
        Make sure the required number of sharees are present in the calendar.

        @param n: number of sharees
        @type n: C{int}
        """

        users = []
        uids = []
        for i in range(n - self.currentCount):
            index = self.currentCount + i + 2
            users.append("user%02d" % (index,))
            uids.append("urn:uuid:user%02d" % (index,))
        session.addInvitees(URL(path=calendarhref), uids, True)

        # Now accept each one
        for user in users:
            acceptor = SQLUsageSession(self.server, self.port, user=user, pswd=user, root="/", calendar="shared")
            notifications = acceptor.getNotifications(URL(path=acceptor.notificationHref))
            principal = principalCache.getPrincipal(acceptor, acceptor.principalPath)
            acceptor.processNotification(principal, notifications[0], True)

        self.currentCount = n
예제 #5
0
    def setUserPswd(self, user, pswd):

        self.session.setUserPswd(user, pswd)
        self.principal = principalCache.getPrincipal(self.session, self.session.principalPath)
예제 #6
0
 def __init__(self, server, port=None, ssl=False, afunix=None, user="", pswd="", principal=None, root=None, logging=False, noHostRedirect=False):
     self.session = CalDAVSession(server, port, ssl, afunix, user, pswd, principal, root, logging, noHostRedirect=noHostRedirect)
     self.principal = principalCache.getPrincipal(self.session, self.session.principalPath)
예제 #7
0
    def setUserPswd(self, user, pswd):

        self.session.setUserPswd(user, pswd)
        self.principal = principalCache.getPrincipal(self.session, self.session.principalPath)
예제 #8
0
 def __init__(self, server, port=None, ssl=False, user="", pswd="", principal=None, root=None, logging=False):
     self.session = CalDAVSession(server, port, ssl, user, pswd, principal, root, logging)
     self.principal = principalCache.getPrincipal(self.session, self.session.principalPath)