From 88b45e12b0c2c9e7f8e386504f2d6808f396560b Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Wed, 13 Mar 2019 23:33:58 -0400 Subject: 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 --- examples/example.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/example.py') 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' -- cgit v1.2.1