def __init__(self, locator, username, hostname):
        CallbackMixin.__init__(self)

        self.cascaders = CascadersData(locator, username)

        self.service = s = service.RpcService()
        self.client = client.RpcClient(self.service, HOST,
                                       PORT, username, hostname)

        s.registerOnCascaderRemovedSubjects(self._onCascaderRemovedSubjects)
        s.registerOnCascaderAddedSubjects(self._onCascaderAddedSubjects)

        s.registerOnCascaderJoined(self._onCascaderJoined)
        s.registerOnCascaderLeft(self._onCascaderLeft)

        s.registerUserAskingForHelp(self._onUserAskingForHelp)

        self.registerOnLogin(self._onLogin)

        self.subjects = set()
        self.cascadeSubjects = set()
        self.cascading = False

        self.username = username
        self.hostname = hostname
Esempio n. 2
0
    def __init__(self, *args, **kwargs):
        CallbackMixin.__init__(self)

        self.messageFunctions = {}
        self.userAskingForHelp = None

        self.cascaderJoined = None
        self.cascaderLeft = None

        self.cascaderAddedSubject = None
        self.cascaderRemovedSubject = None
Esempio n. 3
0
    def __init__(self, service, host, port, username, hostname):
        '''
        service - the service that the client should provide
        host
        port 
        '''
        CallbackMixin.__init__(self)

        self.service = service
        self.host = host 
        self.port = port
        self.username = username
        self.hostname = hostname

        self.factory = pb.PBClientFactory()

        self.queuedFunctions = [] #list of functions queued until login
        
        self.server = None #class that holds the primary server functions

        self.autoReconnect = False