diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-13 23:33:58 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-13 23:33:58 -0400 |
commit | 88b45e12b0c2c9e7f8e386504f2d6808f396560b (patch) | |
tree | 66209a092dc11528f73a9cb1a991c620be09a815 /examples/example.py | |
parent | 23fad46d5187600d52b95125bb1629e491cb9e6f (diff) | |
download | cmd2-git-88b45e12b0c2c9e7f8e386504f2d6808f396560b.tar.gz |
First stage of attribute refactoring
The following are now arguments to cmd2.Cmd.__init__() instead of class attributes:
* allow_redirection
* multiline_commands
* terminators
* shortcuts
Added a couple read-only properties for convenience of cmd2.Cmd accessing immutable members from self.statement_parser
Diffstat (limited to 'examples/example.py')
-rwxr-xr-x | examples/example.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/example.py b/examples/example.py index 04727ec6..145ddb79 100755 --- a/examples/example.py +++ b/examples/example.py @@ -27,14 +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'}) # 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']) # Make maxrepeats settable at runtime self.settable['maxrepeats'] = 'max repetitions for speak command' |