diff options
author | hjoaquim <h.joaquim@campus.fct.unl.pt> | 2024-05-03 18:42:09 +0100 |
---|---|---|
committer | hjoaquim <h.joaquim@campus.fct.unl.pt> | 2024-05-03 18:42:09 +0100 |
commit | 0e3dacc1a38845d8b1205aceaf23223309a71840 (patch) | |
tree | 8d05548be7f766fe8e29c3a0b55933082b7ea175 | |
parent | 3f185a4f3028bff379779eea27ef82301be5676b (diff) |
using the new flags to control messages on the registyr
-rw-r--r-- | cli/openbb_cli/controllers/base_platform_controller.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/openbb_cli/controllers/base_platform_controller.py b/cli/openbb_cli/controllers/base_platform_controller.py index 47f27b271ec..d01b0929f73 100644 --- a/cli/openbb_cli/controllers/base_platform_controller.py +++ b/cli/openbb_cli/controllers/base_platform_controller.py @@ -154,6 +154,14 @@ class PlatformController(BaseController): title = f"{self.PATH}{translator.func.__name__}" if obbject: + if ( + len(session.obbject_registry.obbjects) + >= session.settings.N_TO_KEEP_OBBJECT_REGISTRY + ): + session.console.print( + "Maximum number of OBBjects reached. Removing oldest." + ) + session.obbject_registry.register(obbject) # we need to force to re-link so that the new obbject # is immediately available for data processing commands @@ -161,6 +169,11 @@ class PlatformController(BaseController): # also update the completer self.update_completer(self.choices_default) + if session.settings.SHOW_MSG_OBBJECT_REGISTRY: + session.console.print( + f"Added OBBject to registry. Total: {len(session.obbject_registry.obbjects)}" + ) + if hasattr(ns_parser, "chart") and ns_parser.chart: obbject.show() fig = obbject.chart.fig |