def __init__(self, client, transport, session_id, key=None, proxies={}): """Initializer @param client: the Client instance @param transport: The transport to use to speak the protocol @type transport: L{transport.BaseTransport} @param session_id: the session to join if any @type session_id: string @param key: the key used to authenticate to server when connecting @type key: string @param proxies: a dictonary mapping the proxy type to a L{gnet.proxy.ProxyInfos} instance @type proxies: {type: string, proxy:L{gnet.proxy.ProxyInfos}} """ BaseProtocol.__init__(self, client, transport, proxies) gobject.GObject.__init__(self) self.participants = {} self.__session_id = session_id self.__key = key self.__state = ProtocolState.CLOSED self.__inviting = False self.__invitations = {}
def __init__(self, client, transport, session_id, key=None, proxies={}): """Initializer @param client: the Client instance @param transport: The transport to use to speak the protocol @type transport: L{transport.BaseTransport} @param session_id: the session to join if any @type session_id: string @param key: the key used to authenticate to server when connecting @type key: string @param proxies: a dictonary mapping the proxy type to a L{gnet.proxy.ProxyInfos} instance @type proxies: {type: string, proxy:L{gnet.proxy.ProxyInfos}} """ BaseProtocol.__init__(self, client, transport, proxies) self.participants = {} self.end_points = {} self.inactivity_timer_id = 0 self.keepalive_timer_id = 0 self.__session_id = session_id self.__key = key self.__state = ProtocolState.CLOSED self.__inviting = False self.__invitations = {} logger.info("New switchboard session %s" % session_id) client.profile.connect("end-point-added", self._on_end_point_added) if client.keepalive_conversations: self.keepalive_timer_id = gobject.timeout_add_seconds(8, self._keepalive_conversation)
def __init__(self, client, transport, session_id, key=None, proxies={}): """Initializer @param client: the Client instance @param transport: The transport to use to speak the protocol @type transport: L{transport.BaseTransport} @param session_id: the session to join if any @type session_id: string @param key: the key used to authenticate to server when connecting @type key: string @param proxies: a dictonary mapping the proxy type to a L{gnet.proxy.ProxyInfos} instance @type proxies: {type: string, proxy:L{gnet.proxy.ProxyInfos}} """ BaseProtocol.__init__(self, client, transport, proxies) self.participants = {} self.end_points = {} self.inactivity_timer_id = 0 self.__session_id = session_id self.__key = key self.__state = ProtocolState.CLOSED self.__inviting = False self.__invitations = {} logger.info("New switchboard session %s" % session_id) client.profile.connect("end-point-added", self._on_end_point_added)
def __init__(self, *args, **kwargs): # Call the super class constructor to save the serial port self.api_responses = { self.api_frames[name]['id']['default']: name for name in (b'at_response', b'status', b'tx_status', b'rx', b'rx_explicit', b'rx_io_sample', b'sensor_read', b'node_id_indicator', b'remote_at_response')} BaseProtocol.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): # Call the super class constructor to save the serial port self.api_responses = { self.api_frames[name]['id']['default']: name for name in (b'at_response', b'status', b'tx_status', b'rx', b'rx_explicit', b'rx_io_sample', b'sensor_read', b'node_id_indicator', b'remote_at_response') } BaseProtocol.__init__(self, *args, **kwargs)
def __init__(self, client, transport, proxies={}): """Initializer @param client: the parent instance of L{client.Client} @type client: L{client.Client} @param transport: The transport to use to speak the protocol @type transport: L{transport.BaseTransport} @param proxies: a dictonary mapping the proxy type to a L{gnet.proxy.ProxyInfos} instance @type proxies: {type: string, proxy:L{gnet.proxy.ProxyInfos}} """ BaseProtocol.__init__(self, client, transport, proxies) gobject.GObject.__init__(self) self.__state = ProtocolState.CLOSED self._protocol_version = 0
def __init__(self, client, transport, proxies={}, version=15): """Initializer @param client: the parent instance of L{client.Client} @type client: L{client.Client} @param transport: The transport to use to speak the protocol @type transport: L{transport.BaseTransport} @param proxies: a dictonary mapping the proxy type to a L{gnet.proxy.ProxyInfos} instance @type proxies: {type: string, proxy:L{gnet.proxy.ProxyInfos}} """ BaseProtocol.__init__(self, client, transport, proxies) gobject.GObject.__init__(self) self.__state = ProtocolState.CLOSED self._protocol_version = version self._url_callbacks = {} # tr_id=>callback
def __init__(self, client, transport, proxies={}, version=15): """Initializer @param client: the parent instance of L{client.Client} @type client: L{client.Client} @param transport: The transport to use to speak the protocol @type transport: L{transport.BaseTransport} @param proxies: a dictonary mapping the proxy type to a L{gnet.proxy.ProxyInfos} instance @type proxies: {type: string, proxy:L{gnet.proxy.ProxyInfos}} """ BaseProtocol.__init__(self, client, transport, proxies) Timer.__init__(self) self.__state = ProtocolState.CLOSED self._protocol_version = version self._callbacks = {} # tr_id=>(callback, errback) self._time_id = 0