mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-30 21:22:24 +00:00
Improves the settings/userdata command, and upgrade ruff (#5359)
* Began the fax * Bumped ruff * Fixed a BUNCH of ruff errors * Fixed a lot of ruff errors * Simplify if statements * Fixed black * Updated some stuff * Updated some stuff * A lot more ruff fixes * Added a fix * Added a fix * Fixed mypy * Fixed some stuff * Reverted one thing * Small fix * Small fix * Small fix * Added fix * Added fix * Update requirements
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# pylint: disable=unused-argument
|
||||
import argparse
|
||||
import contextlib
|
||||
import inspect
|
||||
import sys
|
||||
from datetime import datetime, timedelta
|
||||
@@ -370,11 +371,10 @@ class ControllerDoc:
|
||||
|
||||
if len(fullspec.args) > 2:
|
||||
args.update({arg: ["1234"] for arg in fullspec.args[2:]})
|
||||
with patch("openbb_terminal.rich_config.console.print"):
|
||||
try:
|
||||
_ = getattr(self.controller, command)(["--help"], **args)
|
||||
except (SystemExit, AttributeError):
|
||||
pass
|
||||
with patch(
|
||||
"openbb_terminal.rich_config.console.print"
|
||||
), contextlib.suppress(SystemExit, AttributeError):
|
||||
_ = getattr(self.controller, command)(["--help"], **args)
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -460,11 +460,14 @@ class LoadControllersDoc:
|
||||
if ( # noqa: SIM102
|
||||
name != "TerminalController" and "BaseController" not in name
|
||||
): # noqa: SIM102
|
||||
if isclass(obj) and issubclass(obj, BaseController):
|
||||
if trailmap not in self.controller_docs:
|
||||
ctrl = ControllerDoc(obj, trailmap) # type: ignore
|
||||
if ctrl.has_commands():
|
||||
self.controller_docs[trailmap] = ctrl
|
||||
if (
|
||||
isclass(obj)
|
||||
and issubclass(obj, BaseController)
|
||||
and trailmap not in self.controller_docs
|
||||
):
|
||||
ctrl = ControllerDoc(obj, trailmap) # type: ignore
|
||||
if ctrl.has_commands():
|
||||
self.controller_docs[trailmap] = ctrl
|
||||
|
||||
def _get_modules(self) -> Dict[str, ModuleType]:
|
||||
"""Gets all controllers modules"""
|
||||
|
||||
Reference in New Issue
Block a user