def main(): configure.setup_logs() try: config = configure.load_config() except IOError as e: log.critical("Aborting, problem loading config: {0}".format(e), exc_info=True) sys.exit(1) bot = TerminalBot(config) stdio.StandardIO(bot) reactor.run()
def main(): configure.setup_logs() # load config try: config = configure.load_config() except IOError as e: log.critical("Aborting, problem loading config: {0}".format(e), exc_info=True) sys.exit(1) # def shutdown(): # # add shutdown calls here... # reactor.addSystemEventTrigger('before', 'shutdown', shutdown) from twisted.internet import reactor factory = TwoBitBotFactory(config) reactor.connectTCP(config['server'], config['server_port'], factory) reactor.run()