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)
from bot.main import main if __name__ == "__main__": main()
from bot.main import main if __name__ == '__main__': exit(main())
from __future__ import annotations from bot.main import main if __name__ == '__main__': raise SystemExit(main())
def handle(self, *args, **options): from bot.main import main main()
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)
def test_main(self): self.assertEqual(0, main.main())
from bot.main import main if __name__ == '__main__': main().run()