def setUp(self): from pajbot.bot import Bot from pajbot.tbutil import load_config import datetime config = load_config('config.ini') args = Bot.parse_args() self.pajbot = Bot(config, args) self.source = self.pajbot.users['omgthisuserdoesnotexist123'] self.source.username_raw = 'OmgthisuserdoesnotexiSt123' self.source.points = 142 self.source.last_seen = datetime.datetime.strptime('17:01:42', '%H:%M:%S')
def setUp(self): from pajbot.bot import Bot from pajbot.models.user import User, UserManager from pajbot.tbutil import load_config import datetime config = load_config('config.ini') args = Bot.parse_args() self.pajbot = Bot(config, args) self.source = self.pajbot.users['testuser123Kappa'] self.source.username_raw = 'PajladA' self.source.points = 142 self.source.last_seen = datetime.datetime.strptime('17:01:42', '%H:%M:%S')
def setUp(self): from pajbot.bot import Bot from pajbot.models.user import User, UserManager from pajbot.tbutil import load_config import datetime config = load_config('config.ini') args = Bot.parse_args() self.pajbot = Bot(config, args) self.source = self.pajbot.users['testuser123Kappa'] self.source.username_raw = 'PajladA' self.source.points = 142 self.source.last_seen = datetime.datetime.strptime( '17:01:42', '%H:%M:%S')
pajbot = Bot(config, args) pajbot.connect() def on_sigterm(signal, frame): pajbot.quit_bot() sys.exit(0) signal.signal(signal.SIGTERM, on_sigterm) try: pajbot.start() except KeyboardInterrupt: pajbot.quit_bot() pass def handle_exceptions(exctype, value, tb): log.error('Logging an uncaught exception', exc_info=(exctype, value, tb)) if __name__ == '__main__': from pajbot.utils import init_logging sys.excepthook = handle_exceptions args = Bot.parse_args() init_logging('pajbot') run(args)
pajbot = Bot(config, args) pajbot.connect() def on_sigterm(signal, frame): pajbot.quit() sys.exit(0) signal.signal(signal.SIGTERM, on_sigterm) try: pajbot.start() except KeyboardInterrupt: pajbot.quit() pass def handle_exceptions(exctype, value, tb): log.error('Logging an uncaught exception', exc_info=(exctype, value, tb)) if __name__ == "__main__": from pajbot.tbutil import init_logging sys.excepthook = handle_exceptions args = Bot.parse_args() init_logging('pajbot') run(args)