mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-05-07 22:40:49 +08:00
* remove python 3.9 support and code * black * more cli lint * more linting * more lint * fix for tests * docstring grammar police * add lock to to build function to avoid async import race conditions * grammar police * lots more linting * relock
33 lines
794 B
Python
33 lines
794 B
Python
"""OpenBB Platform CLI entry point."""
|
|
|
|
import logging
|
|
import sys
|
|
|
|
from openbb_cli.utils.utils import change_logging_sub_app, reset_logging_sub_app
|
|
|
|
|
|
def main():
|
|
"""Use the main entry point for the OpenBB Platform CLI."""
|
|
print("Loading...\n") # noqa: T201
|
|
|
|
# pylint: disable=import-outside-toplevel
|
|
from openbb_cli.config.setup import bootstrap
|
|
from openbb_cli.controllers.cli_controller import launch
|
|
|
|
bootstrap()
|
|
|
|
dev = "--dev" in sys.argv[1:]
|
|
debug = "--debug" in sys.argv[1:]
|
|
|
|
launch(dev, debug)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
initial_logging_sub_app = change_logging_sub_app()
|
|
try:
|
|
main()
|
|
except Exception:
|
|
logging.exception("An unexpected error occurred")
|
|
finally:
|
|
reset_logging_sub_app(initial_logging_sub_app)
|