Skip to content

Commit 03853d1

Browse files
committed
188 - Save point
1 parent ae971d3 commit 03853d1

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ disable = [
4242
"line-too-long",
4343
"too-many-branches",
4444
"too-many-instance-attributes",
45-
"too-many-locals"
45+
"too-many-locals",
46+
"too-many-statements"
4647
]
4748
good-names = [
4849
"template-python"

sz_tools/sz_command

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,14 @@ _WrappedFunc = TypeVar("_WrappedFunc", bound=Callable[..., Any])
4545

4646
MODULE_NAME = pathlib.Path(__file__).stem
4747

48-
# Per command settings
49-
PER_CMD_SETTINGS = ["json", "jsonl", "color", "colour", "nocolor", "nocolour", "debug", "timer", "page"]
48+
PER_CMD_SETTINGS = ["json", "jsonl", "color", "colour", "nocolor", "nocolour", "debug", "timer", "scroll"]
5049

5150
DEFAULT_CONFIG = {
5251
"format_json": True,
5352
"color_output": True,
5453
"timer": False,
5554
"theme": "TERMINAL",
56-
"page_output": False,
55+
"scroll_output": False,
5756
"debug_sdk_call": False,
5857
"debug_sz_engine": False,
5958
"history_file": True,
@@ -71,7 +70,7 @@ SETTINGS_TO_CONFIG_MAP = {
7170
"debug": ["debug_sdk_call", True],
7271
"debug_sdk": ["debug_sdk_call", True],
7372
"timer": ["timer", True],
74-
"page": ["page_output", True],
73+
"scroll": ["scroll_output", True],
7574
}
7675

7776
# Don't overwrite last command if we still need to use it
@@ -99,7 +98,7 @@ CONFIG_SETTINGS: Dict[str, Dict[str, Any]] = {
9998
"values": [c.lower() for c in Colors.AVAILABLE_THEMES],
10099
"description": "Set color scheme to use",
101100
},
102-
"page_output": {
101+
"scroll_output": {
103102
"values": ["off", "on"],
104103
"description": "Use a pager for content larger than the terminal",
105104
},
@@ -126,7 +125,7 @@ CONFIG_SETTINGS: Dict[str, Dict[str, Any]] = {
126125

127126
def do_methods_decorator(do_method: _WrappedFunc) -> _WrappedFunc:
128127
@functools.wraps(do_method)
129-
def wrapper(self, *args, **kwargs) -> Any:
128+
def wrapper(self, *args: Any, **kwargs: Any) -> Any:
130129
# Remove do_ from wrapped method
131130
sdk_method_name = do_method.__name__[3:]
132131

@@ -582,7 +581,7 @@ class SzCmdShell(cmd.Cmd):
582581
formatted_response: str = print_response(
583582
response,
584583
self.per_cmd_config["format_json"], # type: ignore[arg-type]
585-
self.per_cmd_config["page_output"], # type: ignore[arg-type]
584+
self.per_cmd_config["scroll_output"], # type: ignore[arg-type]
586585
self.per_cmd_config["color_output"], # type: ignore[arg-type]
587586
color=color,
588587
)
@@ -781,7 +780,7 @@ class SzCmdShell(cmd.Cmd):
781780
- nocolor / nocolour
782781
- debug
783782
- timer
784-
- page
783+
- scroll
785784
786785
{colorize_str('- Examples:', 'dim')}
787786
- get_entity_by_entity_id 1001 jsonl
@@ -845,21 +844,21 @@ class SzCmdShell(cmd.Cmd):
845844
Notes:
846845
- Retrieve the active configuration identifier with get_active_config_id
847846
848-
- Retrieve a list of configurations and identifiers with get_configs"""
847+
- Retrieve a list of configurations and identifiers with get_config_registry"""
849848

850849
sz_config = self.sz_configmgr.create_config_from_config_id(kwargs["parsed_args"].config_id)
851850
response = sz_config.export()
852851
self.last_response = self.output_response(response)
853852

854853
@do_methods_decorator
855-
def do_get_configs(self) -> None:
854+
def do_get_config_registry(self) -> None:
856855
"""
857-
Get a list of current configurations
856+
Get details of current registered configurations
858857
859858
Syntax:
860-
get_configs"""
859+
get_config_registry"""
861860

862-
response = self.sz_configmgr.get_configs()
861+
response = self.sz_configmgr.get_config_registry()
863862
self.last_response = self.output_response(response)
864863

865864
@do_methods_decorator
@@ -889,7 +888,7 @@ class SzCmdShell(cmd.Cmd):
889888
new_default_config_id = Configuration identifier
890889
891890
Notes:
892-
- Retrieve a list of configurations and identifiers with get_configs"""
891+
- Retrieve a list of configurations and identifiers with get_config_registry"""
893892

894893
self.sz_configmgr.replace_default_config_id(
895894
kwargs["parsed_args"].current_default_config_id,
@@ -2297,7 +2296,7 @@ class SzCmdShell(cmd.Cmd):
22972296
return kwargs["cmd_settings"]
22982297

22992298
@cmd_settings_decorator
2300-
def complete_get_configs(self, text: str, line: str, begidx: int, endidx: int, **kwargs) -> List[str]:
2299+
def complete_get_config_registry(self, text: str, line: str, begidx: int, endidx: int, **kwargs) -> List[str]:
23012300
return kwargs["cmd_settings"]
23022301

23032302
@cmd_settings_decorator

sz_tools/sz_configtool

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ class SzCfgShell(cmd.Cmd):
754754
except SzError as err:
755755
colorize_msg(err, "error")
756756

757-
def do_getConfigList(self, arg):
757+
def do_getConfigRegistry(self, arg):
758758
"""
759759
Returns the list of all known configurations
760760
@@ -763,7 +763,7 @@ class SzCfgShell(cmd.Cmd):
763763
"""
764764
arg = self.check_arg_for_output_format("record", arg)
765765
try:
766-
config_list = self.sz_configmgr.get_configs()
766+
config_list = self.sz_configmgr.get_config_registry()
767767
self.print_json_record(json.loads(config_list)["CONFIGS"])
768768
except SzError as err:
769769
colorize_msg(err, "error")

sz_tools/sz_file_loader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ def startup_info(
608608
try:
609609
lic_info = _json_loads(product.get_license())
610610
ver_info = _json_loads(product.get_version())
611-
config_list = _json_loads(configmgr.get_configs())
611+
config_list = _json_loads(configmgr.get_config_registry())
612612
active_cfg_id = engine.get_active_config_id()
613613
ds_info = _json_loads(diag.get_datastore_info())
614614
except SzError as err:

0 commit comments

Comments
 (0)