diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-14 20:47:22 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-14 20:47:22 -0400 |
commit | 88d8b57221662b42cfcd7490314c2869c4ea9bfe (patch) | |
tree | eec3c8b233c65bc2727ce589c15742ad764f56a9 /cmd2/cmd2.py | |
parent | cd8183d463e50f0a5c9a9ff548554dc3c71124da (diff) | |
download | cmd2-git-88d8b57221662b42cfcd7490314c2869c4ea9bfe.tar.gz |
Converted class attributes which aren't intended to be dynamically settable to instance attributes
The following are now instance attributes:
- allow_cli_args
- default_to_shell
- quit_on_sigint
The following class attribute was deleted due to lack of use:
- reserved_words
The following instance attribute was deleted due to lack of use:
- keywords
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 5e0c1c07..8f5dfef3 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -298,12 +298,6 @@ class Cmd(cmd.Cmd): """ DEFAULT_SHORTCUTS = {'?': 'help', '!': 'shell', '@': 'load', '@@': '_relative_load'} - # Attributes which are NOT dynamically settable at runtime - allow_cli_args = True # Should arguments passed on the command-line be processed as commands? - default_to_shell = False # Attempt to run unrecognized commands as shell commands - quit_on_sigint = False # Quit the loop on interrupt instead of just resetting prompt - reserved_words = [] - # Attributes which ARE dynamically settable at runtime colors = constants.COLORS_TERMINAL continuation_prompt = '> ' @@ -371,6 +365,11 @@ class Cmd(cmd.Cmd): # Call super class constructor super().__init__(completekey=completekey, stdin=stdin, stdout=stdout) + # Attributes which should NOT be dynamically settable at runtime + self.allow_cli_args = True # Should arguments passed on the command-line be processed as commands? + self.default_to_shell = False # Attempt to run unrecognized commands as shell commands + self.quit_on_sigint = False # Quit the loop on interrupt instead of just resetting prompt + # Commands to exclude from the help menu and tab completion self.hidden_commands = ['eof', 'eos', '_relative_load'] @@ -386,7 +385,6 @@ class Cmd(cmd.Cmd): self.pystate = {} self.py_history = [] self.pyscript_name = 'app' - self.keywords = self.reserved_words + self.get_all_commands() if shortcuts is None: shortcuts = self.DEFAULT_SHORTCUTS |