def run(self): help_event = Event(event="help", interface="email", identifier=self.conf['email_id']) subscribe(help_event, self.help_handler) cmd_event = Event(event="command", interface="email", identifier=self.conf['email_id']) subscribe(cmd_event, self.cmd_handler)
def run(self): self.todo_list = [] help_event = Event(event="help", identifier=self.conf['id']) subscribe(help_event, self.help_handler) cmd_event = Event(event="command", identifier=self.conf['id']) subscribe(cmd_event, self.cmd_handler)
def run(self): self.search = {} """ {channel:[email]} """ help_event = Event(event="help", identifier=self.conf['im_id']) subscribe(help_event, self.help_handler) cmd_event = Event(event="command", identifier=self.conf['im_id']) subscribe(cmd_event, self.cmd_handler)
def run(self): """ Initialize email interface """ self.update_db() event = Event(event='send', interface='email', \ identifier=self.identifier) subscribe(event, self.send_handle) sleep(1) # allow the rest of the interfaces to boot before parse email period = self.conf['pop_period'] periodic(self.fetch, period)
def run(self): event = Event(event='send', interface='xmpp', identifier=self.identifier) subscribe(event, self.handler) jid = self.conf['jid'] password = self.conf['password'] server = self.conf['server'] port = int(self.conf['port']) self.log(_("Connect to jid: %(jid)s") % self.conf) self.xmpp = XMPPClient(self.identifier, jid, password) self.xmpp.register_plugin('xep_0030') # Service Discovery self.xmpp.register_plugin('xep_0199') # XMPP Ping if self.xmpp.connect((server, port)): self.xmpp.process() else: self.log(_("error conecting to xmpp: %s") % jid)
def run(self): """ Initialize mediawiki interface """ host = self.conf['host'] path = self.conf['path'] self.wiki = mwclient.Site(host, path) user = self.conf['user'] password = self.conf['password'] self.wiki.login(user, password) self.log(_("Login to %s wiki") % (host)) event_read = Event(event='read', interface='mediawiki', identifier=self.identifier) subscribe(event_read, self.read) event_write = Event(event='write', interface='mediawiki', identifier=self.identifier) subscribe(event_write, self.write)
def run(self): event_send = Event(event='send', interface='irc', identifier=self.identifier) subscribe(event_send, self.send_handler) event_history = Event(event='history', interface='irc', identifier=self.identifier) subscribe(event_history, self.history_handler) event_rcv = Event(event='receive', interface='irc', identifier=self.identifier) subscribe(event_rcv, self.rcv_handler) self.store = '' self.update_db() server = self.conf['server'] port = int(self.conf['port']) nick = self.conf['nick'] channels = [i.strip() for i in self.conf['channels'].split(',')] self.log(_("Connect to %(server)s:%(port)s nick:%(nick)s " \ "channels:%(channels)s") % self.conf) try: self.irc = IrcClient(self.identifier, channels, nick, server, port) self.irc.start() except irclib.ServerConnectionError, x: self.log(_("error conecting to server: %s") % x)
def run(self): # self._ = {channel: {'talking': nick, 'words': [nicks], # 'session': str}} self._ = {} help_event = Event(event="help", interface="irc", \ identifier=self.conf['irc_id']) subscribe(help_event, self.help_handler) cmd_event = Event(event="command", interface="irc", \ identifier=self.conf['irc_id']) subscribe(cmd_event, self.cmd_handler) rcv_event = Event(event="receive", interface="irc", \ identifier=self.conf['irc_id']) subscribe(rcv_event, self.rcv_handler)
def run(self): cmd_event = Event(event="command") subscribe(cmd_event, self.cmd_handler)
def __init__(self, *args): Complement.__init__(self, *args) name = self.__module__.split(".")[-1] event = Event(event="db", interface=name, identifier=self.identifier) subscribe(event, self.db_handler)
def run(self): help_event = Event(event="help") subscribe(help_event, self.help_handler) cmd_event = Event(event="command") subscribe(cmd_event, self.cmd_handler)