def __init__(self, server_id, xmpp_prof): XMPPClient.__init__(self, server_id, xmpp_prof) self.im_acc = {} self.notify_dispatch = '{0}@{1}'.format(config.NOTIFYIN, config.MSG_SERVER) self.bus = dbus.SessionBus() self.obj = None self.purple = None self.connectPidginDBus() self.cb_init() self.map_im_accounts() self.frm = switchKeyValue(self.im_acc)
def __init__(self): XMPPClient.__init__(self, lconf.SERVERNAME, { 'user': lconf.LEAFSERVER, 'pass': lconf.LEAFSERVER_PASS, 'realm': lconf.MSG_SERVER, }) self.log = mylogger('LeafController', 'leaf.log') self.shutdown = False self.notify_in = '{0}@{1}/{2}'.format(lconf.NOTIFYIN, lconf.MSG_SERVER, lconf.ROOT_SERVER_NAME) self.rexes.insert(0, (r'^{0}@{1}(/[^:]+)?:(?P<command>\w+)=(?P<param>' '[^,]*)$'.format(lconf.NOTIFYOUT, lconf.MSG_SERVER), self.handleLeafCommand)) self.pdu = messaging.PDU() self.check_sms = False if 'linux' in sys.platform: p = '/home/szhan/Dev' else: p = sys.path[0] self.saengine = sqlalchemy.create_engine(lconf.DBCONN_URI) SABase.metadata.create_all(self.saengine) self.sasession = scoped_session(sessionmaker(bind=self.saengine)) threading.Thread(target=self.sendMessageToCore).start()
def __init__(self, server_id, xmpp_prof): XMPPClient.__init__(self, server_id, xmpp_prof) self.to = { 'ym': 'yahoo.{0}'.format(self.xmpp_prof['realm']) } self.frm = switchKeyValue(self.to) self.notify_dispatch = '{0}@{1}'.format(config.NOTIFYIN, config.MSG_SERVER)