@@ -793,8 +793,10 @@ class Cmd(cmd.Cmd):
793793 commentGrammars = pyparsing .Or ([pyparsing .pythonStyleComment , pyparsing .cStyleComment ])
794794 commentInProgress = pyparsing .Literal ('/*' ) + pyparsing .SkipTo (pyparsing .stringEnd ^ '*/' )
795795 legalChars = u'!#$%.:?@_-' + pyparsing .alphanums + pyparsing .alphas8bit
796+ multilineCommands = [] # NOTE: Multiline commands can never be abbreviated, even if abbrev is True
796797 prefixParser = pyparsing .Empty ()
797798 redirector = '>' # for sending output to file
799+ shortcuts = {'?' : 'help' , '!' : 'shell' , '@' : 'load' , '@@' : '_relative_load' }
798800 terminators = [';' ] # make sure your terminators are not in legalChars!
799801
800802 # Attributes which are NOT dynamically settable at runtime
@@ -870,12 +872,9 @@ def __init__(self, completekey='tab', stdin=None, stdout=None, persistent_histor
870872 # Call super class constructor. Need to do it in this way for Python 2 and 3 compatibility
871873 cmd .Cmd .__init__ (self , completekey = completekey , stdin = stdin , stdout = stdout )
872874
873- self .multiline_commands = [] # NOTE: Multiline commands can never be abbreviated, even if abbrev is True
874- self .shortcuts = {'?' : 'help' , '!' : 'shell' , '@' : 'load' , '@@' : '_relative_load' }
875-
876875 # Commands to exclude from the help menu or history command
877876 self .exclude_from_help = ['do_eof' , 'do_eos' , 'do__relative_load' ]
878- self .exclude_from_history = '''history histor histo hist his hi h edit edi ed e eof eo eos''' .split ()
877+ self .excludeFromHistory = '''history histor histo hist his hi h edit edi ed e eof eo eos''' .split ()
879878
880879 self ._finalize_app_parameters ()
881880
@@ -884,7 +883,7 @@ def __init__(self, completekey='tab', stdin=None, stdout=None, persistent_histor
884883 self .pystate = {}
885884 self .keywords = self .reserved_words + [fname [3 :] for fname in dir (self ) if fname .startswith ('do_' )]
886885 self .parser_manager = ParserManager (redirector = self .redirector , terminators = self .terminators ,
887- multilineCommands = self .multiline_commands ,
886+ multilineCommands = self .multilineCommands ,
888887 legalChars = self .legalChars , commentGrammars = self .commentGrammars ,
889888 commentInProgress = self .commentInProgress ,
890889 case_insensitive = self .case_insensitive ,
@@ -1399,7 +1398,7 @@ def _func_named(self, arg):
13991398 result = target
14001399 else :
14011400 if self .abbrev : # accept shortened versions of commands
1402- funcs = [func for func in self .keywords if func .startswith (arg ) and func not in self .multiline_commands ]
1401+ funcs = [func for func in self .keywords if func .startswith (arg ) and func not in self .multilineCommands ]
14031402 if len (funcs ) == 1 :
14041403 result = 'do_' + funcs [0 ]
14051404 return result
@@ -1418,7 +1417,7 @@ def onecmd(self, line):
14181417 return self .default (statement )
14191418
14201419 # Since we have a valid command store it in the history
1421- if statement .parsed .command not in self .exclude_from_history :
1420+ if statement .parsed .command not in self .excludeFromHistory :
14221421 self .history .append (statement .parsed .raw )
14231422
14241423 try :
0 commit comments