mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
rename method and add description
This commit is contained in:
@@ -242,9 +242,10 @@ class StaticCommandRunner:
|
||||
return result
|
||||
|
||||
@classmethod
|
||||
def __execute(
|
||||
def __command(
|
||||
cls, system_settings: SystemSettings, func: Callable, kwargs: Dict[str, Any]
|
||||
) -> CommandOutput:
|
||||
"""Run a command and return the output"""
|
||||
try:
|
||||
context_manager: Union[warnings.catch_warnings, ContextManager[None]] = (
|
||||
warnings.catch_warnings(record=True)
|
||||
@@ -283,6 +284,7 @@ class StaticCommandRunner:
|
||||
route: str,
|
||||
**kwargs,
|
||||
) -> None:
|
||||
"""Create a chart from the command output"""
|
||||
try:
|
||||
command_output.chart = cls.charting_manager.chart(
|
||||
user_settings=user_settings,
|
||||
@@ -305,6 +307,7 @@ class StaticCommandRunner:
|
||||
func: Callable,
|
||||
kwargs: Dict[str, Any],
|
||||
) -> CommandOutput:
|
||||
"""Execute a function and return the output"""
|
||||
user_settings = execution_context.user_settings
|
||||
system_settings = execution_context.system_settings
|
||||
|
||||
@@ -329,7 +332,7 @@ class StaticCommandRunner:
|
||||
# commands.py and the function signature does not expect "chart"
|
||||
kwargs.pop("chart", None)
|
||||
|
||||
command_output = cls.__execute(
|
||||
command_output = cls.__command(
|
||||
system_settings=system_settings,
|
||||
func=func,
|
||||
kwargs=kwargs,
|
||||
|
||||
Reference in New Issue
Block a user