def new_connection(self, protocol, username, password, server, port=None, channel=None): if protocol == "IRC": # self._connection = IrcConnection(self.listen) # self._connection.connect(username=config.IRC_NAME+"_"+name, server=config.IRC_SERVER+":"+str(config.IRC_PORT), channel=config.IRC_CHANNEL) # if protocol == "XMPP": # self._connection = XmppConnection(self.listen) # self._connection.connect(username=config.XMPP_NAME, password=config.XMPP_PASSWORD, channel=config.XMPP_CHANNEL) self._connection = IrcConnection(username=username, password=password, server=server, channel=channel, listener=self.listen) self._connection.connect() if protocol == "XMPP": self._connection = XmppConnection( username=username, password=password, server="conference.jabber.ccc.de", channel="thm", listener=self.listen) self._connection.connect()
''' Created on Jan 7, 2012 @author: s0x ''' from net.xmpp_connection import XmppConnection conn = XmppConnection(username='******', password='******', channel='thm', server='conference.jabber.ccc.de') conn.connect()