From 6cb882e3420fef1497955c9b4c7f0d8674e1557d Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Wed, 20 Feb 2019 22:56:25 -0500 Subject: Changed examples to reflect that settable doesn't need to be updated before calling init() --- examples/example.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'examples/example.py') diff --git a/examples/example.py b/examples/example.py index 264abd84..04727ec6 100755 --- a/examples/example.py +++ b/examples/example.py @@ -30,13 +30,15 @@ class CmdLineApp(cmd2.Cmd): self.multiline_commands = ['orate'] self.maxrepeats = 3 - # Add stuff to settable and shortcuts before calling base class initializer - self.settable['maxrepeats'] = 'max repetitions for speak command' + # 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) + # Make maxrepeats settable at runtime + self.settable['maxrepeats'] = 'max repetitions for speak command' + speak_parser = argparse.ArgumentParser() speak_parser.add_argument('-p', '--piglatin', action='store_true', help='atinLay') speak_parser.add_argument('-s', '--shout', action='store_true', help='N00B EMULATION MODE') -- cgit v1.2.1