def __init__(self, nick, *args, **kwds): config = kwds.pop("config", None) if not config: config = load_config() self.config = config self.queue_conn = self.make_queuer() self.queue_consumer = self.make_queue_consumer() super(HardyMixin, self).__init__(nick, *args, **kwds)
def main(cls=HardyMasterConnection): from hnilsson import load_config cnf = load_config() cnf.setup_logging() reginfo = (cnf.irc_username, cnf.irc_realname) m = cls(nick=cnf.irc_nick, autoregister=reginfo, config=cnf) m.connect(cnf.irc_server) try: m.run() finally: m.stop()