def __init__(self, jid): MessageProtocol.__init__(self) self.jid = jid self.help = [] self.commands = {} for (name, klass) in inspect.getmembers(commands, inspect.isclass): if not name in ("Command", "User"): self.commands[name] = klass if hasattr(klass, "aliases"): for alias in klass.aliases: self.commands[alias] = klass if name in HELP_COMMANDS: if hasattr(klass, "usage"): self.help.append("%s %s" % (name, klass.usage)) self.help = "\n".join(self.help) self.session = accounts.Datastore().get_session()
def __init__(self, jid): MessageProtocol.__init__(self) self.jid = jid self.help = [] self.commands = {} for (name, klass) in inspect.getmembers(commands, inspect.isclass): if not name in ('Command', 'User'): self.commands[name] = klass if hasattr(klass, 'aliases'): for alias in klass.aliases: self.commands[alias] = klass if name in HELP_COMMANDS: if hasattr(klass, 'usage'): self.help.append("%s %s" % (name, klass.usage)) self.help = "\n".join(self.help) self.session = accounts.Datastore().get_session()
def __init__(self, backend_interaction, component=False): ''' @param backend_interaction: The handler for cumminicating with the logic of the backend. @type backend_interaction: ServerInteraction ''' #init XEPs MessageProtocol.__init__(self) LocationQuery.__init__(self) JabberRPC.__init__(self) IQBasedAvatar.__init__(self) PresenceClientProtocol.__init__(self) self.component = component #register rpc functions self.registerMethodCall('getSettings', self.onGetSettings) self.registerMethodCall('setSettings', self.onSetSettings) self.registerMethodCall('getUserInfo', self.onGetUserInfo) self.registerMethodCall('createFriendship', self.onCreateFriendship) self.registerMethodCall('destroyFriendship', self.onDestroyFriendship) #give the backend (ServerInteraction) a reference to this protocol handler self.backend = backend_interaction self.backend.set_server_component(self)
def __init__(self, output, hostname, targetjid, *args, **kwargs): self.output = output self.hostname = hostname self.targetjid = targetjid MessageProtocol.__init__(self, *args, **kwargs)
def __init__(self, component=False): MessageProtocol.__init__(self) self.component = component
def __init__(self, *args, **kwargs): MessageProtocol.__init__(self, *args, **kwargs) self.running = True self.emails = []
def __init__(self, xmpphandler): MessageProtocol.__init__(self) self._xmpphandler = xmpphandler self._xmpphandler.setProtocol(self)
def __init__(self): MessageProtocol.__init__(self)
def __init__(self, component=False, socket=None): MessageProtocol.__init__(self) self.component = component self._socket = socket self._message_count = 0 self._begin_time = None
def __init__(self, component, jid_act_as, jid_proxy_to): MessageProtocol.__init__(self) XmppProxyHandler.__init__(self, component, jid_act_as, jid_proxy_to)
def __init__(self, bot): self.bot = bot MessageProtocol.__init__(self)
def __init__(self, bot): self.bot=bot MessageProtocol.__init__(self)
def __init__(self): MessageProtocol.__init__(self) self.mpdclient = mpdclient.MpdClient() self.mpdclient.connect()
def __init__(self, endpoint): MessageProtocol.__init__(self) self.endpoint = endpoint