diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-18 22:47:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-18 22:47:24 -0400 |
commit | 57dd827963491439e40eb5dfe20811c14ea757ff (patch) | |
tree | 9503d37d813a83a4c991d8ff8b2ed92e4a97e4ce /examples/arg_print.py | |
parent | 83a28727d012ab067d18d89d3b1ce6410459f67b (diff) | |
parent | 4523bc6a9fc36ff879b6767dcd23923aa40c4c47 (diff) | |
download | cmd2-git-57dd827963491439e40eb5dfe20811c14ea757ff.tar.gz |
Merge pull request #648 from python-cmd2/attributes
Converted class attributes to instance attributes
Diffstat (limited to 'examples/arg_print.py')
-rwxr-xr-x | examples/arg_print.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/arg_print.py b/examples/arg_print.py index 18d21787..edcc8444 100755 --- a/examples/arg_print.py +++ b/examples/arg_print.py @@ -19,12 +19,9 @@ class ArgumentAndOptionPrinter(cmd2.Cmd): def __init__(self): # Create command shortcuts which are typically 1 character abbreviations which can be used in place of a command - self.shortcuts.update({'$': 'aprint', '%': 'oprint'}) - - # Make sure to call this super class __init__ *after* setting and/or updating shortcuts - super().__init__() - # NOTE: It is critical that the super class __init__ method be called AFTER updating certain parameters which - # are not settable at runtime. This includes the shortcuts, multiline_commands, etc. + shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts.update({'$': 'aprint', '%': 'oprint'}) + super().__init__(shortcuts=shortcuts) def do_aprint(self, statement): """Print the argument string this basic command is called with.""" |