summaryrefslogtreecommitdiff
path: root/examples/example.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-03-18 22:49:42 -0400
committerGitHub <noreply@github.com>2019-03-18 22:49:42 -0400
commit2f24a8ad3eeb2fdf699d1e2a9d4f05429fe879c4 (patch)
treeb836270cf61175d1e4a434fd8cae08f0ffd998a2 /examples/example.py
parent96d176cc3d8198913693a42c7dd983cf69a165bd (diff)
parent57dd827963491439e40eb5dfe20811c14ea757ff (diff)
downloadcmd2-git-2f24a8ad3eeb2fdf699d1e2a9d4f05429fe879c4.tar.gz
Merge branch 'master' into load_generate_transcript
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()