Example #1
0
    def setUp(self):
        from tyggbot.tyggbot import TyggBot
        from tyggbot.models.user import User, UserManager
        from tyggbot.tbutil import load_config
        import datetime

        config = load_config('config.ini')
        args = TyggBot.parse_args()
        self.tyggbot = TyggBot(config, args)
        self.source = self.tyggbot.users['testuser123Kappa']
        self.source.username_raw = 'PajladA'
        self.source.points = 142
        self.source.last_seen = datetime.datetime.strptime('17:01:42', '%H:%M:%S')
Example #2
0
    def setUp(self):
        from tyggbot.tyggbot import TyggBot
        from tyggbot.models.user import User, UserManager
        from tyggbot.tbutil import load_config
        import datetime

        config = load_config('config.ini')
        args = TyggBot.parse_args()
        self.tyggbot = TyggBot(config, args)
        self.source = self.tyggbot.users['testuser123Kappa']
        self.source.username_raw = 'PajladA'
        self.source.points = 142
        self.source.last_seen = datetime.datetime.strptime(
            '17:01:42', '%H:%M:%S')
Example #3
0
    tyggbot = TyggBot(config, args)

    tyggbot.connect()

    def on_sigterm(signal, frame):
        tyggbot.quit()
        sys.exit(0)

    signal.signal(signal.SIGTERM, on_sigterm)

    try:
        tyggbot.start()
    except KeyboardInterrupt:
        tyggbot.quit()
        pass


def handle_exceptions(exctype, value, tb):
    log.error('Logging an uncaught exception', exc_info=(exctype, value, tb))

if __name__ == "__main__":
    from tyggbot.tbutil import init_logging

    sys.excepthook = handle_exceptions

    args = TyggBot.parse_args()

    init_logging('tyggbot')
    run(args)
Example #4
0
    tyggbot = TyggBot(config, args)

    tyggbot.connect()

    def on_sigterm(signal, frame):
        tyggbot.quit()
        sys.exit(0)

    signal.signal(signal.SIGTERM, on_sigterm)

    try:
        tyggbot.start()
    except KeyboardInterrupt:
        tyggbot.quit()
        pass


def handle_exceptions(exctype, value, tb):
    log.error('Logging an uncaught exception', exc_info=(exctype, value, tb))


if __name__ == "__main__":
    from tyggbot.tbutil import init_logging

    sys.excepthook = handle_exceptions

    args = TyggBot.parse_args()

    init_logging('tyggbot')
    run(args)