diff options
-rwxr-xr-x | README.md | 2 | ||||
-rw-r--r-- | cmd2/__init__.py | 1 | ||||
-rw-r--r-- | docs/settingchanges.rst | 2 | ||||
-rwxr-xr-x | examples/arg_print.py | 2 | ||||
-rwxr-xr-x | examples/cmd_as_argument.py | 2 | ||||
-rwxr-xr-x | examples/colors.py | 2 | ||||
-rwxr-xr-x | examples/decorator_example.py | 2 | ||||
-rwxr-xr-x | examples/example.py | 2 | ||||
-rwxr-xr-x | examples/pirate.py | 2 | ||||
-rwxr-xr-x | examples/plumbum_colors.py | 2 |
10 files changed, 10 insertions, 9 deletions
@@ -241,7 +241,7 @@ class CmdLineApp(cmd2.Cmd): def __init__(self): self.maxrepeats = 3 - shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts = dict(cmd2.DEFAULT_SHORTCUTS) shortcuts.update({'&': 'speak'}) # Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell diff --git a/cmd2/__init__.py b/cmd2/__init__.py index 1072a3c7..e86fb9bb 100644 --- a/cmd2/__init__.py +++ b/cmd2/__init__.py @@ -12,4 +12,5 @@ except DistributionNotFound: from .cmd2 import Cmd, Statement, EmptyStatement, categorize from .cmd2 import with_argument_list, with_argparser, with_argparser_and_unknown_args, with_category +from .constants import DEFAULT_SHORTCUTS from .pyscript_bridge import CommandResult diff --git a/docs/settingchanges.rst b/docs/settingchanges.rst index aa6d9084..0e4feac1 100644 --- a/docs/settingchanges.rst +++ b/docs/settingchanges.rst @@ -33,7 +33,7 @@ To define more shortcuts, update the dict ``App.shortcuts`` with the class App(Cmd2): def __init__(self): - shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts = dict(cmd2.DEFAULT_SHORTCUTS) shortcuts.update({'*': 'sneeze', '~': 'squirm'}) cmd2.Cmd.__init__(self, shortcuts=shortcuts) diff --git a/examples/arg_print.py b/examples/arg_print.py index 48bcbd13..3f7f3815 100755 --- a/examples/arg_print.py +++ b/examples/arg_print.py @@ -19,7 +19,7 @@ class ArgumentAndOptionPrinter(cmd2.Cmd): def __init__(self): # Create command shortcuts which are typically 1 character abbreviations which can be used in place of a command - shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts = dict(cmd2.DEFAULT_SHORTCUTS) shortcuts.update({'$': 'aprint', '%': 'oprint'}) super().__init__(shortcuts=shortcuts) diff --git a/examples/cmd_as_argument.py b/examples/cmd_as_argument.py index 1e7901b9..49a50670 100755 --- a/examples/cmd_as_argument.py +++ b/examples/cmd_as_argument.py @@ -28,7 +28,7 @@ class CmdLineApp(cmd2.Cmd): MUMBLE_LAST = ['right?'] def __init__(self): - shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts = dict(cmd2.DEFAULT_SHORTCUTS) shortcuts.update({'&': 'speak'}) # Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell super().__init__(allow_cli_args=False, use_ipython=True, multiline_commands=['orate'], shortcuts=shortcuts) diff --git a/examples/colors.py b/examples/colors.py index fdc0e0bd..f8a9dfdb 100755 --- a/examples/colors.py +++ b/examples/colors.py @@ -63,7 +63,7 @@ class CmdLineApp(cmd2.Cmd): MUMBLE_LAST = ['right?'] def __init__(self): - shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts = dict(cmd2.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=True, multiline_commands=['orate'], shortcuts=shortcuts) diff --git a/examples/decorator_example.py b/examples/decorator_example.py index bb0d58c0..4f68653e 100755 --- a/examples/decorator_example.py +++ b/examples/decorator_example.py @@ -19,7 +19,7 @@ import cmd2 class CmdLineApp(cmd2.Cmd): """ Example cmd2 application. """ def __init__(self, ip_addr=None, port=None, transcript_files=None): - shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts = dict(cmd2.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, transcript_files=transcript_files, multiline_commands=['orate'], diff --git a/examples/example.py b/examples/example.py index a1ec893c..24be5d5d 100755 --- a/examples/example.py +++ b/examples/example.py @@ -26,7 +26,7 @@ class CmdLineApp(cmd2.Cmd): MUMBLE_LAST = ['right?'] def __init__(self): - shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts = dict(cmd2.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, multiline_commands=['orate'], shortcuts=shortcuts) diff --git a/examples/pirate.py b/examples/pirate.py index 9abbe4e6..699ee80c 100755 --- a/examples/pirate.py +++ b/examples/pirate.py @@ -29,7 +29,7 @@ class Pirate(cmd2.Cmd): """A piratical example cmd2 application involving looting and drinking.""" def __init__(self): """Initialize the base class as well as this one""" - shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts = dict(cmd2.DEFAULT_SHORTCUTS) shortcuts.update({'~': 'sing'}) super().__init__(multiline_commands=['sing'], terminators=[MULTILINE_TERMINATOR, '...'], shortcuts=shortcuts) diff --git a/examples/plumbum_colors.py b/examples/plumbum_colors.py index 774dc7e4..2c57c22b 100755 --- a/examples/plumbum_colors.py +++ b/examples/plumbum_colors.py @@ -66,7 +66,7 @@ class CmdLineApp(cmd2.Cmd): MUMBLE_LAST = ['right?'] def __init__(self): - shortcuts = dict(self.DEFAULT_SHORTCUTS) + shortcuts = dict(cmd2.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=True, multiline_commands=['orate'], shortcuts=shortcuts) |