def setupEventQueue(self): self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo) for event in bb.event.ui_queue: self.events.queue_event(event) _, error = self.connection.runCommand(["setFeatures", self.featureset]) if error: # disconnect the client, we can't make the setFeature work self.connection.removeClient() # no need to log it here, the error shall be sent to the client raise BaseException(error)
def connect(self): if not self.observer_only: token = self.connection.addClient() else: token = "observer" if token is None: return None self.transport.set_connection_token(token) self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo, self.featureset) for event in bb.event.ui_queue: self.events.queue_event(event) return self
def connect(self): if not self.observer_only: token = self.connection.addClient() else: token = "observer" if token is None: return None self.transport.set_connection_token(token) self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo) for event in bb.event.ui_queue: self.events.queue_event(event) _, error = self.connection.runCommand(["setFeatures", self.featureset]) if error: # no need to log it here, the error shall be sent to the client raise BaseException(error) return self
def __init__(self, host, port, clientinfo=("localhost", 0), observer_only=False, featureset=None): self.connection, self.transport = _create_server(host, port) self.clientinfo = clientinfo self.observer_only = observer_only if featureset: self.featureset = featureset else: self.featureset = [] self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo) _, error = self.connection.runCommand(["setFeatures", self.featureset]) if error: # disconnect the client, we can't make the setFeature work self.connection.removeClient() # no need to log it here, the error shall be sent to the client raise BaseException(error)
def __init__(self, serverinfo): self.connection = _create_server(serverinfo.host, serverinfo.port) self.events = uievent.BBUIEventQueue(self.connection) for event in bb.event.ui_queue: self.events.queue_event(event)
def __init__(self, serverinfo): self.connection = xmlrpclib.Server("http://%s:%s" % (serverinfo.host, serverinfo.port), allow_none=True) self.events = uievent.BBUIEventQueue(self.connection)