|
89 | 89 | except ImportError: # pragma: no cover |
90 | 90 | ipython_available = False |
91 | 91 |
|
92 | | -INTERNAL_COMMAND_EPILOG = ("Notes:\n" |
93 | | - " This command is for internal use and is not intended to be called from the\n" |
94 | | - " command line.") |
95 | | - |
96 | | -# Sorting keys for strings |
97 | | -ALPHABETICAL_SORT_KEY = utils.norm_fold |
98 | | -NATURAL_SORT_KEY = utils.natural_keys |
99 | | - |
100 | 92 |
|
101 | 93 | class _SavedReadlineSettings: |
102 | 94 | """readline settings that are backed up when switching between readline environments""" |
@@ -140,6 +132,14 @@ class Cmd(cmd.Cmd): |
140 | 132 | """ |
141 | 133 | DEFAULT_EDITOR = utils.find_editor() |
142 | 134 |
|
| 135 | + INTERNAL_COMMAND_EPILOG = ("Notes:\n" |
| 136 | + " This command is for internal use and is not intended to be called from the\n" |
| 137 | + " command line.") |
| 138 | + |
| 139 | + # Sorting keys for strings |
| 140 | + ALPHABETICAL_SORT_KEY = utils.norm_fold |
| 141 | + NATURAL_SORT_KEY = utils.natural_keys |
| 142 | + |
143 | 143 | def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *, |
144 | 144 | persistent_history_file: str = '', persistent_history_length: int = 1000, |
145 | 145 | startup_script: str = '', use_ipython: bool = False, |
@@ -194,7 +194,7 @@ def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *, |
194 | 194 | self.continuation_prompt = '> ' |
195 | 195 | self.debug = False |
196 | 196 | self.echo = False |
197 | | - self.editor = self.DEFAULT_EDITOR |
| 197 | + self.editor = Cmd.DEFAULT_EDITOR |
198 | 198 | self.feedback_to_output = False # Do not include nonessentials in >, | output by default (things like timing) |
199 | 199 | self.locals_in_py = False |
200 | 200 |
|
@@ -330,7 +330,7 @@ def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *, |
330 | 330 | # command and category names |
331 | 331 | # alias, macro, settable, and shortcut names |
332 | 332 | # tab completion results when self.matches_sorted is False |
333 | | - self.default_sort_key = ALPHABETICAL_SORT_KEY |
| 333 | + self.default_sort_key = Cmd.ALPHABETICAL_SORT_KEY |
334 | 334 |
|
335 | 335 | ############################################################################################################ |
336 | 336 | # The following variables are used by tab-completion functions. They are reset each time complete() is run |
|
0 commit comments