summaryrefslogtreecommitdiff
path: root/examples/example.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/example.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/example.py')
-rwxr-xr-xexamples/example.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/example.py b/examples/example.py
index 04727ec6..9f9c0304 100755
--- a/examples/example.py
+++ b/examples/example.py
@@ -27,16 +27,13 @@ class CmdLineApp(cmd2.Cmd):
MUMBLE_LAST = ['right?']
def __init__(self):
- self.multiline_commands = ['orate']
- self.maxrepeats = 3
-
- # Add stuff to shortcuts before calling base class initializer
- self.shortcuts.update({'&': 'speak'})
-
+ shortcuts = dict(self.DEFAULT_SHORTCUTS)
+ shortcuts.update({'&': 'speak'})
# Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell
- super().__init__(use_ipython=False)
+ super().__init__(use_ipython=False, multiline_commands=['orate'], shortcuts=shortcuts)
# Make maxrepeats settable at runtime
+ self.maxrepeats = 3
self.settable['maxrepeats'] = 'max repetitions for speak command'
speak_parser = argparse.ArgumentParser()