예제 #1
0
def startup():
    enhance_thread_names()
    setup_signals()

    config, parser = parse_args()

    initialize_logging(config.logging_file, config.logging_level)

    if LOG.isEnabledFor(logging.DEBUG):
        LOG.debug("Config Sources:\n%s", parser.format_values())

    main(config)
예제 #2
0
from bot.main import main

if __name__ == "__main__":
    main()
예제 #3
0
from bot.main import main

if __name__ == '__main__':
    exit(main())
예제 #4
0
from __future__ import annotations

from bot.main import main

if __name__ == '__main__':
    raise SystemExit(main())
예제 #5
0
 def handle(self, *args, **options):
     from bot.main import main
     main()
예제 #6
0
    IS_DEBUG = auto()
    REDIS_HOST = auto()
    REDIS_PORT = auto()


if __name__ == '__main__':
    env = Env()
    env.read_env()
    env_configuration: bool = env.bool(
        ConfigurationParameters.ENV_CONFIGURATION.name, False)

    if env_configuration:
        tg_token = env(ConfigurationParameters.TG_TOKEN.name)
        feeds_path = env.str(ConfigurationParameters.FEEDS_PATH.name)
        redis_host = env.str(ConfigurationParameters.REDIS_HOST.name)
        redis_port = env.int(ConfigurationParameters.REDIS_PORT.name,
                             DEFAULT_REDIS_PORT)
        is_debug = env.bool(ConfigurationParameters.IS_DEBUG.name,
                            DEFAULT_IS_DEBUG)
        tg_proxy = env(ConfigurationParameters.TG_PROXY.name, DEFAULT_TG_PROXY)

        main(tg_token=tg_token,
             feeds_path=feeds_path,
             redis_host=redis_host,
             redis_port=redis_port,
             is_debug=is_debug,
             tg_proxy=tg_proxy)

    else:
        Fire(main)
예제 #7
0
 def test_main(self):
     self.assertEqual(0, main.main())
예제 #8
0
from bot.main import main

if __name__ == '__main__':
    main().run()