diff options
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/arg_print.py | 7 | ||||
-rwxr-xr-x | examples/argparse_example.py | 2 | ||||
-rwxr-xr-x | examples/example.py | 2 | ||||
-rwxr-xr-x | examples/pirate.py | 2 |
4 files changed, 5 insertions, 8 deletions
diff --git a/examples/arg_print.py b/examples/arg_print.py index 90df053a..b2f0fcda 100755 --- a/examples/arg_print.py +++ b/examples/arg_print.py @@ -19,16 +19,13 @@ class ArgumentAndOptionPrinter(cmd2.Cmd): """ Example cmd2 application where we create commands that just print the arguments they are called with.""" def __init__(self): - # Uncomment this line to disable Python-style comments but still allow C-style comments - # self.commentGrammars = pyparsing.Or([pyparsing.cStyleComment]) - # Create command aliases which are shorter self.shortcuts.update({'$': 'aprint', '%': 'oprint'}) - # Make sure to call this super class __init__ *after* setting commentGrammars and/or updating shortcuts + # Make sure to call this super class __init__ *after* setting and/or updating shortcuts super().__init__() # NOTE: It is critical that the super class __init__ method be called AFTER updating certain parameters which - # are not settable at runtime. This includes the commentGrammars, shortcuts, multilineCommands, etc. + # are not settable at runtime. This includes the shortcuts, multiline_commands, etc. def do_aprint(self, arg): """Print the argument string this basic command is called with.""" diff --git a/examples/argparse_example.py b/examples/argparse_example.py index e8afef5c..6e5dcf35 100755 --- a/examples/argparse_example.py +++ b/examples/argparse_example.py @@ -20,7 +20,7 @@ from cmd2.cmd2 import Cmd, with_argparser, with_argument_list class CmdLineApp(Cmd): """ Example cmd2 application. """ def __init__(self, ip_addr=None, port=None, transcript_files=None): - self.multilineCommands = ['orate'] + self.multiline_commands = ['orate'] self.shortcuts.update({'&': 'speak'}) self.maxrepeats = 3 diff --git a/examples/example.py b/examples/example.py index 1fc6bf6d..f07b9c74 100755 --- a/examples/example.py +++ b/examples/example.py @@ -27,7 +27,7 @@ class CmdLineApp(Cmd): MUMBLE_LAST = ['right?'] def __init__(self): - self.multilineCommands = ['orate'] + self.multiline_commands = ['orate'] self.maxrepeats = 3 # Add stuff to settable and shortcuts before calling base class initializer diff --git a/examples/pirate.py b/examples/pirate.py index 2daa8631..f6f4c629 100755 --- a/examples/pirate.py +++ b/examples/pirate.py @@ -14,7 +14,7 @@ class Pirate(Cmd): """A piratical example cmd2 application involving looting and drinking.""" def __init__(self): self.default_to_shell = True - self.multilineCommands = ['sing'] + self.multiline_commands = ['sing'] self.terminators = Cmd.terminators + ['...'] self.songcolor = 'blue' |