rename method and add description

This commit is contained in:
Diogo Sousa
2023-07-26 14:32:00 +01:00
parent cc1a84b4d0
commit 531fa104c8

View File

@@ -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,