Files
OpenBB/cli/openbb_cli/cli.py
Danglewood 9f0d592839 [Feature] Remove Python 3.9 (#7235)
* 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
2025-10-10 23:16:16 +00:00

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)