summaryrefslogtreecommitdiff
path: root/examples/arg_print.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-03-18 22:47:24 -0400
committerGitHub <noreply@github.com>2019-03-18 22:47:24 -0400
commit57dd827963491439e40eb5dfe20811c14ea757ff (patch)
tree9503d37d813a83a4c991d8ff8b2ed92e4a97e4ce /examples/arg_print.py
parent83a28727d012ab067d18d89d3b1ce6410459f67b (diff)
parent4523bc6a9fc36ff879b6767dcd23923aa40c4c47 (diff)
downloadcmd2-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-xexamples/arg_print.py9
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."""