From 64ee90066d4e9ffd2e343c5aaf9744a11762389d Mon Sep 17 00:00:00 2001 From: Mathew Guest Date: Fri, 13 Mar 2020 18:49:04 -0600 Subject: [PATCH] changed names for more informative tracebacks --- app_skellington/_util.py | 4 ++-- app_skellington/app_container.py | 6 +++--- app_skellington/cfg.py | 2 +- app_skellington/cli.py | 5 +++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app_skellington/_util.py b/app_skellington/_util.py index 1fd4c04..bced5c9 100644 --- a/app_skellington/_util.py +++ b/app_skellington/_util.py @@ -110,7 +110,7 @@ def register_class_as_commands(app, submenu, cls_object): def create_func(constructor, cls_method): def func(*args, **kwargs): - obj = constructor() - return cls_method(obj, *args, **kwargs) + cmd_class_instance = constructor() + return cls_method(cmd_class_instance, *args, **kwargs) return func diff --git a/app_skellington/app_container.py b/app_skellington/app_container.py index ef2891d..2aac628 100644 --- a/app_skellington/app_container.py +++ b/app_skellington/app_container.py @@ -125,10 +125,10 @@ class ApplicationContainer: model_constructor: reference to object constructor. """ dependency_names = args - dep_references = [] + dependencies = [] for dep_name in dependency_names: - dep_references.append(self[dep_name]) - return model_constructor(*dep_references) + dependencies.append(self[dep_name]) + return model_constructor(*dependencies) def _get_config_filepath(self, app_name, app_author, config_filename='config.ini'): """ diff --git a/app_skellington/cfg.py b/app_skellington/cfg.py index 90aeba8..f255cc3 100644 --- a/app_skellington/cfg.py +++ b/app_skellington/cfg.py @@ -43,7 +43,7 @@ class Config: def __getitem__(self, key): """ - Returns the vaLue of the configuration item identified by . + Returns the value of the configuration item identified by . """ try: return self.config_obj[key].dict() diff --git a/app_skellington/cli.py b/app_skellington/cli.py index 3c53bd4..c1a845b 100644 --- a/app_skellington/cli.py +++ b/app_skellington/cli.py @@ -285,7 +285,8 @@ class CommandTree: raise app_container.NoCommandSpecified('No command specified.') def _invoke_command(self, cmd, args): - func = cmd.callback + command_to_be_invoked = cmd.callback + func = command_to_be_invoked sig = cmd.func_signature params = sig.parameters params = [params[paramname] for paramname in params] @@ -296,7 +297,7 @@ class CommandTree: _bootstrap_logger.info('function: %s', func) _bootstrap_logger.info('function args: %s', func_args) - return func(*func_args) + return command_to_be_invoked(*func_args) def _get_subparser(self): return self.root_parser._subparsers._actions[1]