diff options
Diffstat (limited to 'doxygen/man/man3/cmd2_Cmd.3')
-rw-r--r-- | doxygen/man/man3/cmd2_Cmd.3 | 2098 |
1 files changed, 0 insertions, 2098 deletions
diff --git a/doxygen/man/man3/cmd2_Cmd.3 b/doxygen/man/man3/cmd2_Cmd.3 deleted file mode 100644 index cd5c11d..0000000 --- a/doxygen/man/man3/cmd2_Cmd.3 +++ /dev/null @@ -1,2098 +0,0 @@ -.TH "cmd2::Cmd" 3 "Fri Sep 9 2011" "Cmd2" \" -*- nroff -*- -.ad l -.nh -.SH NAME -cmd2::Cmd \- -.SH SYNOPSIS -.br -.PP -.PP -Inherited by \fBexample::CmdLineApp\fP, \fBpirate6::Pirate\fP, \fBpirate7::Pirate\fP, and \fBpirate8::Pirate\fP'\&. -.SS "Public Member Functions" - -.in +1c -.ti -1c -.RI "def \fB__init__\fP" -.br -.ti -1c -.RI "def \fBcmdloop\fP" -.br -.ti -1c -.RI "def \fBcolorize\fP" -.br -.ti -1c -.RI "def \fBcomplete_statement\fP" -.br -.ti -1c -.RI "def \fBdo__relative_load\fP" -.br -.ti -1c -.RI "def \fBdo_cmdenvironment\fP" -.br -.ti -1c -.RI "def \fBdo_ed\fP" -.br -.ti -1c -.RI "def \fBdo_EOF\fP" -.br -.ti -1c -.RI "def \fBdo_help\fP" -.br -.ti -1c -.RI "def \fBdo_history\fP" -.br -.ti -1c -.RI "def \fBdo_list\fP" -.br -.ti -1c -.RI "def \fBdo_load\fP" -.br -.ti -1c -.RI "def \fBdo_pause\fP" -.br -.ti -1c -.RI "def \fBdo_py\fP" -.br -.ti -1c -.RI "def \fBdo_quit\fP" -.br -.ti -1c -.RI "def \fBdo_run\fP" -.br -.ti -1c -.RI "def \fBdo_save\fP" -.br -.ti -1c -.RI "def \fBdo_set\fP" -.br -.ti -1c -.RI "def \fBdo_shell\fP" -.br -.ti -1c -.RI "def \fBdo_shortcuts\fP" -.br -.ti -1c -.RI "def \fBdo_show\fP" -.br -.ti -1c -.RI "def \fBfileimport\fP" -.br -.ti -1c -.RI "def \fBfunc_named\fP" -.br -.ti -1c -.RI "def \fBlast_matching\fP" -.br -.ti -1c -.RI "def \fBonecmd\fP" -.br -.ti -1c -.RI "def \fBonecmd_plus_hooks\fP" -.br -.ti -1c -.RI "def \fBparsed\fP" -.br -.ti -1c -.RI "def \fBperror\fP" -.br -.ti -1c -.RI "def \fBpfeedback\fP" -.br -.ti -1c -.RI "def \fBpostparse\fP" -.br -.ti -1c -.RI "def \fBpostparsing_postcmd\fP" -.br -.ti -1c -.RI "def \fBpostparsing_precmd\fP" -.br -.ti -1c -.RI "def \fBpoutput\fP" -.br -.ti -1c -.RI "def \fBpreparse\fP" -.br -.ti -1c -.RI "def \fBpseudo_raw_input\fP" -.br -.ti -1c -.RI "def \fBread_file_or_url\fP" -.br -.ti -1c -.RI "def \fBredirect_output\fP" -.br -.ti -1c -.RI "def \fBrestore_output\fP" -.br -.ti -1c -.RI "def \fBrun_commands_at_invocation\fP" -.br -.ti -1c -.RI "def \fBrunTranscriptTests\fP" -.br -.ti -1c -.RI "def \fBselect\fP" -.br -.in -1c -.SS "Public Attributes" - -.in +1c -.ti -1c -.RI "\fBblankLineTerminationParser\fP" -.br -.ti -1c -.RI "\fBblankLineTerminator\fP" -.br -.ti -1c -.RI "\fBcontinuation_prompt\fP" -.br -.ti -1c -.RI "\fBhistory\fP" -.br -.ti -1c -.RI "\fBinitial_stdout\fP" -.br -.ti -1c -.RI "\fBinputParser\fP" -.br -.ti -1c -.RI "\fBintro\fP" -.br -.ti -1c -.RI "\fBkept_sys\fP" -.br -.ti -1c -.RI "\fBkeywords\fP" -.br -.ti -1c -.RI "\fBlastcmd\fP" -.br -.ti -1c -.RI "\fBmultilineCommand\fP" -.br -.ti -1c -.RI "\fBmultilineParser\fP" -.br -.ti -1c -.RI "\fBold_completer\fP" -.br -.ti -1c -.RI "\fBparser\fP" -.br -.ti -1c -.RI "\fBprompt\fP" -.br -.ti -1c -.RI "\fBpystate\fP" -.br -.ti -1c -.RI "\fBredirect\fP" -.br -.ti -1c -.RI "\fBshortcuts\fP" -.br -.ti -1c -.RI "\fBsingleLineParser\fP" -.br -.ti -1c -.RI "\fBstdin\fP" -.br -.ti -1c -.RI "\fBstdout\fP" -.br -.ti -1c -.RI "\fBuse_rawinput\fP" -.br -.in -1c -.SS "Static Public Attributes" - -.in +1c -.ti -1c -.RI "\fBabbrev\fP = True" -.br -.ti -1c -.RI "\fBblankLinesAllowed\fP = False" -.br -.ti -1c -.RI "\fBcase_insensitive\fP = True" -.br -.ti -1c -.RI "dictionary \fBcolorcodes\fP" -.br -.ti -1c -.RI "tuple \fBcolors\fP = (platform\&.system() != 'Windows')" -.br -.ti -1c -.RI "tuple \fBcommentGrammars\fP = pyparsing\&.Or([pyparsing\&.pythonStyleComment, pyparsing\&.cStyleComment])" -.br -.ti -1c -.RI "tuple \fBcommentInProgress\fP = pyparsing\&.Literal('/*')" -.br -.ti -1c -.RI "string \fBcontinuation_prompt\fP = '> '" -.br -.ti -1c -.RI "\fBcurrent_script_dir\fP = None" -.br -.ti -1c -.RI "\fBdebug\fP = False" -.br -.ti -1c -.RI "string \fBdefault_file_name\fP = 'command\&.txt'" -.br -.ti -1c -.RI "\fBdefault_to_shell\fP = False" -.br -.ti -1c -.RI "string \fBdefaultExtension\fP = 'txt'" -.br -.ti -1c -.RI "\fBdo__load\fP = do_load" -.br -.ti -1c -.RI "\fBdo_edit\fP = do_ed" -.br -.ti -1c -.RI "\fBdo_eof\fP = do_EOF" -.br -.ti -1c -.RI "\fBdo_exit\fP = do_quit" -.br -.ti -1c -.RI "\fBdo_hi\fP = do_history" -.br -.ti -1c -.RI "\fBdo_l\fP = do_list" -.br -.ti -1c -.RI "\fBdo_li\fP = do_list" -.br -.ti -1c -.RI "\fBdo_q\fP = do_quit" -.br -.ti -1c -.RI "\fBdo_r\fP = do_run" -.br -.ti -1c -.RI "\fBecho\fP = False" -.br -.ti -1c -.RI "tuple \fBeditor\fP = os\&.environ\&.get('EDITOR')" -.br -.ti -1c -.RI "string \fBeditor\fP = 'notepad'" -.br -.ti -1c -.RI "string \fBexcludeFromHistory\fP = '''run r list l \fBhistory\fP hi ed edit li eof'''" -.br -.ti -1c -.RI "\fBfeedback_to_output\fP = False" -.br -.ti -1c -.RI "string \fBhelp\fP = 'describe function of parameter'" -.br -.ti -1c -.RI "\fBkept_state\fP = None" -.br -.ti -1c -.RI "string \fBlegalChars\fP = u'!#$%\&.:?@_'" -.br -.ti -1c -.RI "\fBlocals_in_py\fP = True" -.br -.ti -1c -.RI "list \fBmultilineCommands\fP = []" -.br -.ti -1c -.RI "string \fBnoSpecialParse\fP = 'set ed edit exit'" -.br -.ti -1c -.RI "tuple \fBprefixParser\fP = pyparsing\&.Empty()" -.br -.ti -1c -.RI "\fBquiet\fP = False" -.br -.ti -1c -.RI "string \fBredirector\fP = '>'" -.br -.ti -1c -.RI "list \fBreserved_words\fP = []" -.br -.ti -1c -.RI "tuple \fBsaveparser\fP" -.br -.ti -1c -.RI "tuple \fBsettable\fP" -.br -.ti -1c -.RI "dictionary \fBshortcuts\fP = {'?': '\fBhelp\fP', '!': 'shell', '@': 'load', '@@': '_relative_load'}" -.br -.ti -1c -.RI "list \fBterminators\fP = [';']" -.br -.ti -1c -.RI "\fBtiming\fP = False" -.br -.ti -1c -.RI "tuple \fBurlre\fP = re\&.compile('(https?://[-\\\\w\\\\\&./]+)')" -.br -.in -1c -.SS "Private Member Functions" - -.in +1c -.ti -1c -.RI "def \fB_cmdloop\fP" -.br -.ti -1c -.RI "def \fB_default\fP" -.br -.ti -1c -.RI "def \fB_init_parser\fP" -.br -.in -1c -.SS "Static Private Attributes" - -.in +1c -.ti -1c -.RI "\fB_STOP_AND_EXIT\fP = True" -.br -.ti -1c -.RI "int \fB_STOP_SCRIPT_NO_EXIT\fP = 999" -.br -.in -1c -.SH "Detailed Description" -.PP -Definition at line 361 of file cmd2\&.py'\&. -.SH "Constructor & Destructor Documentation" -.PP -.SS "def cmd2::Cmd::__init__ (self, args, kwargs)" -.PP -Definition at line 469 of file cmd2\&.py'\&. -.PP -.nf -469 -470 def __init__(self, *args, **kwargs): -471 cmd\&.Cmd\&.__init__(self, *args, **kwargs) -472 self\&.initial_stdout = sys\&.stdout -473 self\&.history = History() -474 self\&.pystate = {} -475 self\&.shortcuts = sorted(self\&.shortcuts\&.items(), reverse=True) -476 self\&.keywords = self\&.reserved_words + [fname[3:] for fname in dir(self) -477 if fname\&.startswith('do_')] -478 self\&._init_parser() - -.fi -.SH "Member Function Documentation" -.PP -.SS "def cmd2::Cmd::_cmdloop (self, intro = \fCNone\fP)\fC [private]\fP".PP -.nf -Repeatedly issue a prompt, accept input, parse an initial prefix -off the received input, and dispatch to action methods, passing them -the remainder of the line as argument. -.fi -.PP - -.PP -Definition at line 895 of file cmd2\&.py'\&. -.PP -Referenced by cmdloop()\&. -.PP -.nf -895 -896 def _cmdloop(self, intro=None): -897 '''Repeatedly issue a prompt, accept input, parse an initial prefix -898 off the received input, and dispatch to action methods, passing them -899 the remainder of the line as argument\&. -900 ''' -901 -902 # An almost perfect copy from Cmd; however, the pseudo_raw_input portion -903 # has been split out so that it can be called separately -904 -905 self\&.preloop() -906 if self\&.use_rawinput and self\&.completekey: -907 try: -908 import readline -909 self\&.old_completer = readline\&.get_completer() -910 readline\&.set_completer(self\&.complete) -911 readline\&.parse_and_bind(self\&.completekey+': complete') -912 except ImportError: -913 pass -914 try: -915 if intro is not None: -916 self\&.intro = intro -917 if self\&.intro: -918 self\&.stdout\&.write(str(self\&.intro)+'\n') -919 stop = None -920 while not stop: -921 if self\&.cmdqueue: -922 line = self\&.cmdqueue\&.pop(0) -923 else: -924 line = self\&.pseudo_raw_input(self\&.prompt) -925 if (self\&.echo) and (isinstance(self\&.stdin, file)): -926 self\&.stdout\&.write(line + '\n') -927 stop = self\&.onecmd_plus_hooks(line) -928 self\&.postloop() -929 finally: -930 if self\&.use_rawinput and self\&.completekey: -931 try: -932 import readline -933 readline\&.set_completer(self\&.old_completer) -934 except ImportError: -935 pass -936 return stop - -.fi -.SS "def cmd2::Cmd::_default (self, statement)\fC [private]\fP" -.PP -Definition at line 868 of file cmd2\&.py'\&. -.PP -References pirate6::Pirate::default(), pirate8::Pirate::default(), pirate7::Pirate::default(), default_to_shell, and postparsing_postcmd()\&. -.PP -.nf -868 -869 def _default(self, statement): -870 arg = statement\&.full_parsed_statement() -871 if self\&.default_to_shell: -872 result = os\&.system(arg) -873 if not result: -874 return self\&.postparsing_postcmd(None) -875 return self\&.postparsing_postcmd(self\&.default(arg)) - -.fi -.SS "def cmd2::Cmd::_init_parser (self)\fC [private]\fP" -.PP -Definition at line 493 of file cmd2\&.py'\&. -.PP -.nf -493 -494 def _init_parser(self): -495 r''' -496 >>> c = Cmd() -497 >>> c\&.multilineCommands = ['multiline'] -498 >>> c\&.case_insensitive = True -499 >>> c\&._init_parser() -500 >>> print (c\&.parser\&.parseString('')\&.dump()) -501 [] -502 >>> print (c\&.parser\&.parseString('')\&.dump()) -503 [] -504 >>> print (c\&.parser\&.parseString('/* empty command */')\&.dump()) -505 [] -506 >>> print (c\&.parser\&.parseString('plainword')\&.dump()) -507 ['plainword', ''] -508 - command: plainword -509 - statement: ['plainword', ''] -510 - command: plainword -511 >>> print (c\&.parser\&.parseString('termbare;')\&.dump()) -512 ['termbare', '', ';', ''] -513 - command: termbare -514 - statement: ['termbare', '', ';'] -515 - command: termbare -516 - terminator: ; -517 - terminator: ; -518 >>> print (c\&.parser\&.parseString('termbare; suffx')\&.dump()) -519 ['termbare', '', ';', 'suffx'] -520 - command: termbare -521 - statement: ['termbare', '', ';'] -522 - command: termbare -523 - terminator: ; -524 - suffix: suffx -525 - terminator: ; -526 >>> print (c\&.parser\&.parseString('barecommand')\&.dump()) -527 ['barecommand', ''] -528 - command: barecommand -529 - statement: ['barecommand', ''] -530 - command: barecommand -531 >>> print (c\&.parser\&.parseString('COMmand with args')\&.dump()) -532 ['command', 'with args'] -533 - args: with args -534 - command: command -535 - statement: ['command', 'with args'] -536 - args: with args -537 - command: command -538 >>> print (c\&.parser\&.parseString('command with args and terminator; and suffix')\&.dump()) -539 ['command', 'with args and terminator', ';', 'and suffix'] -540 - args: with args and terminator -541 - command: command -542 - statement: ['command', 'with args and terminator', ';'] -543 - args: with args and terminator -544 - command: command -545 - terminator: ; -546 - suffix: and suffix -547 - terminator: ; -548 >>> print (c\&.parser\&.parseString('simple | piped')\&.dump()) -549 ['simple', '', '|', ' piped'] -550 - command: simple -551 - pipeTo: piped -552 - statement: ['simple', ''] -553 - command: simple -554 >>> print (c\&.parser\&.parseString('double-pipe || is not a pipe')\&.dump()) -555 ['double', '-pipe || is not a pipe'] -556 - args: -pipe || is not a pipe -557 - command: double -558 - statement: ['double', '-pipe || is not a pipe'] -559 - args: -pipe || is not a pipe -560 - command: double -561 >>> print (c\&.parser\&.parseString('command with args, terminator;sufx | piped')\&.dump()) -562 ['command', 'with args, terminator', ';', 'sufx', '|', ' piped'] -563 - args: with args, terminator -564 - command: command -565 - pipeTo: piped -566 - statement: ['command', 'with args, terminator', ';'] -567 - args: with args, terminator -568 - command: command -569 - terminator: ; -570 - suffix: sufx -571 - terminator: ; -572 >>> print (c\&.parser\&.parseString('output into > afile\&.txt')\&.dump()) -573 ['output', 'into', '>', 'afile\&.txt'] -574 - args: into -575 - command: output -576 - output: > -577 - outputTo: afile\&.txt -578 - statement: ['output', 'into'] -579 - args: into -580 - command: output -581 >>> print (c\&.parser\&.parseString('output into;sufx | pipethrume plz > afile\&.txt')\&.dump()) -582 ['output', 'into', ';', 'sufx', '|', ' pipethrume plz', '>', 'afile\&.txt'] -583 - args: into -584 - command: output -585 - output: > -586 - outputTo: afile\&.txt -587 - pipeTo: pipethrume plz -588 - statement: ['output', 'into', ';'] -589 - args: into -590 - command: output -591 - terminator: ; -592 - suffix: sufx -593 - terminator: ; -594 >>> print (c\&.parser\&.parseString('output to paste buffer >> ')\&.dump()) -595 ['output', 'to paste buffer', '>>', ''] -596 - args: to paste buffer -597 - command: output -598 - output: >> -599 - statement: ['output', 'to paste buffer'] -600 - args: to paste buffer -601 - command: output -602 >>> print (c\&.parser\&.parseString('ignore the /* commented | > */ stuff;')\&.dump()) -603 ['ignore', 'the /* commented | > */ stuff', ';', ''] -604 - args: the /* commented | > */ stuff -605 - command: ignore -606 - statement: ['ignore', 'the /* commented | > */ stuff', ';'] -607 - args: the /* commented | > */ stuff -608 - command: ignore -609 - terminator: ; -610 - terminator: ; -611 >>> print (c\&.parser\&.parseString('has > inside;')\&.dump()) -612 ['has', '> inside', ';', ''] -613 - args: > inside -614 - command: has -615 - statement: ['has', '> inside', ';'] -616 - args: > inside -617 - command: has -618 - terminator: ; -619 - terminator: ; -620 >>> print (c\&.parser\&.parseString('multiline has > inside an unfinished command')\&.dump()) -621 ['multiline', ' has > inside an unfinished command'] -622 - multilineCommand: multiline -623 >>> print (c\&.parser\&.parseString('multiline has > inside;')\&.dump()) -624 ['multiline', 'has > inside', ';', ''] -625 - args: has > inside -626 - multilineCommand: multiline -627 - statement: ['multiline', 'has > inside', ';'] -628 - args: has > inside -629 - multilineCommand: multiline -630 - terminator: ; -631 - terminator: ; -632 >>> print (c\&.parser\&.parseString('multiline command /* with comment in progress;')\&.dump()) -633 ['multiline', ' command /* with comment in progress;'] -634 - multilineCommand: multiline -635 >>> print (c\&.parser\&.parseString('multiline command /* with comment complete */ is done;')\&.dump()) -636 ['multiline', 'command /* with comment complete */ is done', ';', ''] -637 - args: command /* with comment complete */ is done -638 - multilineCommand: multiline -639 - statement: ['multiline', 'command /* with comment complete */ is done', ';'] -640 - args: command /* with comment complete */ is done -641 - multilineCommand: multiline -642 - terminator: ; -643 - terminator: ; -644 >>> print (c\&.parser\&.parseString('multiline command ends\n\n')\&.dump()) -645 ['multiline', 'command ends', '\n', '\n'] -646 - args: command ends -647 - multilineCommand: multiline -648 - statement: ['multiline', 'command ends', '\n', '\n'] -649 - args: command ends -650 - multilineCommand: multiline -651 - terminator: ['\n', '\n'] -652 - terminator: ['\n', '\n'] -653 >>> print (c\&.parser\&.parseString('multiline command 'with term; ends' now\n\n')\&.dump()) -654 ['multiline', 'command 'with term; ends' now', '\n', '\n'] -655 - args: command 'with term; ends' now -656 - multilineCommand: multiline -657 - statement: ['multiline', 'command 'with term; ends' now', '\n', '\n'] -658 - args: command 'with term; ends' now -659 - multilineCommand: multiline -660 - terminator: ['\n', '\n'] -661 - terminator: ['\n', '\n'] -662 >>> print (c\&.parser\&.parseString('what if 'quoted strings /* seem to ' start comments?')\&.dump()) -663 ['what', 'if 'quoted strings /* seem to ' start comments?'] -664 - args: if 'quoted strings /* seem to ' start comments? -665 - command: what -666 - statement: ['what', 'if 'quoted strings /* seem to ' start comments?'] -667 - args: if 'quoted strings /* seem to ' start comments? -668 - command: what -669 ''' -670 #outputParser = (pyparsing\&.Literal('>>') | (pyparsing\&.WordStart() + '>') | pyparsing\&.Regex('[^=]>'))('output') -671 outputParser = (pyparsing\&.Literal(self\&.redirector *2) | \ -672 (pyparsing\&.WordStart() + self\&.redirector) | \ -673 pyparsing\&.Regex('[^=]' + self\&.redirector))('output') -674 -675 terminatorParser = pyparsing\&.Or([(hasattr(t, 'parseString') and t) or pyparsing\&.Literal(t) for t in self\&.terminators])('terminator') -676 stringEnd = pyparsing\&.stringEnd ^ '\nEOF' -677 self\&.multilineCommand = pyparsing\&.Or([pyparsing\&.Keyword(c, caseless=self\&.case_insensitive) for c in self\&.multilineCommands])('multilineCommand') -678 oneLineCommand = (~self\&.multilineCommand + pyparsing\&.Word(self\&.legalChars))('command') -679 pipe = pyparsing\&.Keyword('|', identChars='|') -680 self\&.commentGrammars\&.ignore(pyparsing\&.quotedString)\&.setParseAction(lambda x: '') -681 doNotParse = self\&.commentGrammars | self\&.commentInProgress | pyparsing\&.quotedString -682 afterElements = \ -683 pyparsing\&.Optional(pipe + pyparsing\&.SkipTo(outputParser ^ stringEnd, ignore=doNotParse)('pipeTo')) + \ -684 pyparsing\&.Optional(outputParser + pyparsing\&.SkipTo(stringEnd, ignore=doNotParse)\&.setParseAction(lambda x: x[0]\&.strip())('outputTo')) -685 if self\&.case_insensitive: -686 self\&.multilineCommand\&.setParseAction(lambda x: x[0]\&.lower()) -687 oneLineCommand\&.setParseAction(lambda x: x[0]\&.lower()) -688 if self\&.blankLinesAllowed: -689 self\&.blankLineTerminationParser = pyparsing\&.NoMatch -690 else: -691 self\&.blankLineTerminator = (pyparsing\&.lineEnd + pyparsing\&.lineEnd)('terminator') -692 self\&.blankLineTerminator\&.setResultsName('terminator') -693 self\&.blankLineTerminationParser = ((self\&.multilineCommand ^ oneLineCommand) + pyparsing\&.SkipTo(self\&.blankLineTerminator, ignore=doNotParse)\&.setParseAction(lambda x: x[0]\&.strip())('args') + self\&.blankLineTerminator)('statement') -694 self\&.multilineParser = (((self\&.multilineCommand ^ oneLineCommand) + pyparsing\&.SkipTo(terminatorParser, ignore=doNotParse)\&.setParseAction(lambda x: x[0]\&.strip())('args') + terminatorParser)('statement') + -695 pyparsing\&.SkipTo(outputParser ^ pipe ^ stringEnd, ignore=doNotParse)\&.setParseAction(lambda x: x[0]\&.strip())('suffix') + afterElements) -696 self\&.multilineParser\&.ignore(self\&.commentInProgress) -697 self\&.singleLineParser = ((oneLineCommand + pyparsing\&.SkipTo(terminatorParser ^ stringEnd ^ pipe ^ outputParser, ignore=doNotParse)\&.setParseAction(lambda x:x[0]\&.strip())('args'))('statement') + -698 pyparsing\&.Optional(terminatorParser) + afterElements) -699 #self\&.multilineParser = self\&.multilineParser\&.setResultsName('multilineParser') -700 #self\&.singleLineParser = self\&.singleLineParser\&.setResultsName('singleLineParser') -701 self\&.blankLineTerminationParser = self\&.blankLineTerminationParser\&.setResultsName('statement') -702 self\&.parser = self\&.prefixParser + ( -703 stringEnd | -704 self\&.multilineParser | -705 self\&.singleLineParser | -706 self\&.blankLineTerminationParser | -707 self\&.multilineCommand + pyparsing\&.SkipTo(stringEnd, ignore=doNotParse) -708 ) -709 self\&.parser\&.ignore(self\&.commentGrammars) -710 -711 inputMark = pyparsing\&.Literal('<') -712 inputMark\&.setParseAction(lambda x: '') -713 fileName = pyparsing\&.Word(self\&.legalChars + '/\\') -714 inputFrom = fileName('inputFrom') -715 inputFrom\&.setParseAction(replace_with_file_contents) -716 # a not-entirely-satisfactory way of distinguishing < as in 'import from' from < -717 # as in 'lesser than' -718 self\&.inputParser = inputMark + pyparsing\&.Optional(inputFrom) + pyparsing\&.Optional('>') + \ -719 pyparsing\&.Optional(fileName) + (pyparsing\&.stringEnd | '|') -720 self\&.inputParser\&.ignore(self\&.commentInProgress) - -.fi -.SS "def cmd2::Cmd::cmdloop (self)" -.PP -Definition at line 1283 of file cmd2\&.py'\&. -.PP -References _cmdloop(), run_commands_at_invocation(), and runTranscriptTests()\&. -.PP -.nf -1283 -1284 def cmdloop(self): -1285 parser = optparse\&.OptionParser() -1286 parser\&.add_option('-t', '--test', dest='test', -1287 action='store_true', -1288 help='Test against transcript(s) in FILE (wildcards OK)') -1289 (callopts, callargs) = parser\&.parse_args() -1290 if callopts\&.test: -1291 self\&.runTranscriptTests(callargs) -1292 else: -1293 if not self\&.run_commands_at_invocation(callargs): -1294 self\&._cmdloop() - -.fi -.SS "def cmd2::Cmd::colorize (self, val, color)".PP -.nf -Given a string (``val``), returns that string wrapped in UNIX-style - special characters that turn on (and then off) text color and style. - If the ``colors`` environment paramter is ``False``, or the application - is running on Windows, will return ``val`` unchanged. - ``color`` should be one of the supported strings (or styles): - red/blue/green/cyan/magenta, bold, underline.fi -.PP - -.PP -Definition at line 435 of file cmd2\&.py'\&. -.PP -Referenced by pirate7::Pirate::do_sing(), and pirate8::Pirate::do_sing()\&. -.PP -.nf -435 -436 def colorize(self, val, color): -437 '''Given a string (``val``), returns that string wrapped in UNIX-style -438 special characters that turn on (and then off) text color and style\&. -439 If the ``colors`` environment paramter is ``False``, or the application -440 is running on Windows, will return ``val`` unchanged\&. -441 ``color`` should be one of the supported strings (or styles): -442 red/blue/green/cyan/magenta, bold, underline''' -443 if self\&.colors and (self\&.stdout == self\&.initial_stdout): -444 return self\&.colorcodes[color][True] + val + self\&.colorcodes[color][False] -445 return val - -.fi -.SS "def cmd2::Cmd::complete_statement (self, line)".PP -.nf -Keep accepting lines of input until the command is complete..fi -.PP - -.PP -Definition at line 794 of file cmd2\&.py'\&. -.PP -References commentGrammars, continuation_prompt, parsed(), and pseudo_raw_input()\&. -.PP -Referenced by onecmd_plus_hooks()\&. -.PP -.nf -794 -795 def complete_statement(self, line): -796 '''Keep accepting lines of input until the command is complete\&.''' -797 if (not line) or ( -798 not pyparsing\&.Or(self\&.commentGrammars)\&. -799 setParseAction(lambda x: '')\&.transformString(line)): -800 raise EmptyStatement -801 statement = self\&.parsed(line) -802 while statement\&.parsed\&.multilineCommand and (statement\&.parsed\&.terminator == ''): -803 statement = '%s\n%s' % (statement\&.parsed\&.raw, -804 self\&.pseudo_raw_input(self\&.continuation_prompt)) -805 statement = self\&.parsed(statement) -806 if not statement\&.parsed\&.command: -807 raise EmptyStatement -808 return statement - -.fi -.SS "def cmd2::Cmd::do__relative_load (self, arg = \fCNone\fP)".PP -.nf - -Runs commands in script at file or URL; if this is called from within an -already-running script, the filename will be interpreted relative to the -already-running script's directory..fi -.PP - -.PP -Definition at line 1206 of file cmd2\&.py'\&. -.PP -References current_script_dir, and do__load\&. -.PP -.nf -1206 -1207 def do__relative_load(self, arg=None): -1208 ''' -1209 Runs commands in script at file or URL; if this is called from within an -1210 already-running script, the filename will be interpreted relative to the -1211 already-running script's directory\&.''' -1212 if arg: -1213 arg = arg\&.split(None, 1) -1214 targetname, args = arg[0], (arg[1:] or [''])[0] -1215 targetname = os\&.path\&.join(self\&.current_script_dir or '', targetname) -1216 self\&.do__load('%s %s' % (targetname, args)) - -.fi -.SS "def cmd2::Cmd::do_cmdenvironment (self, args)".PP -.nf -Summary report of interactive parameters..fi -.PP - -.PP -Definition at line 446 of file cmd2\&.py'\&. -.PP -References case_insensitive, settable, and terminators\&. -.PP -.nf -446 -447 def do_cmdenvironment(self, args): -448 '''Summary report of interactive parameters\&.''' -449 self\&.stdout\&.write(''' -450 Commands are %(casesensitive)scase-sensitive\&. -451 Commands may be terminated with: %(terminators)s -452 Settable parameters: %(settable)s\n''' % \ -453 { 'casesensitive': (self\&.case_insensitive and 'not ') or '', -454 'terminators': str(self\&.terminators), -455 'settable': ' '\&.join(self\&.settable) -456 }) - -.fi -.SS "def cmd2::Cmd::do_ed (self, arg)".PP -.nf -ed: edit most recent command in text editor -ed [N]: edit numbered command from history -ed [filename]: edit specified file name - -commands are run after editor is closed. -"set edit (program-name)" or set EDITOR environment variable -to control which editing program is used..fi -.PP - -.PP -Definition at line 1128 of file cmd2\&.py'\&. -.PP -References default_file_name, do__load, editor, history, and last_matching()\&. -.PP -.nf -1128 -1129 def do_ed(self, arg): -1130 '''ed: edit most recent command in text editor -1131 ed [N]: edit numbered command from history -1132 ed [filename]: edit specified file name -1133 -1134 commands are run after editor is closed\&. -1135 'set edit (program-name)' or set EDITOR environment variable -1136 to control which editing program is used\&.''' -1137 if not self\&.editor: -1138 raise EnvironmentError('Please use 'set editor' to specify your text editing program of choice\&.') -1139 filename = self\&.default_file_name -1140 if arg: -1141 try: -1142 buffer = self\&.last_matching(int(arg)) -1143 except ValueError: -1144 filename = arg -1145 buffer = '' -1146 else: -1147 buffer = self\&.history[-1] -1148 -1149 if buffer: -1150 f = open(os\&.path\&.expanduser(filename), 'w') -1151 f\&.write(buffer or '') -1152 f\&.close() -1153 -1154 os\&.system('%s %s' % (self\&.editor, filename)) - self\&.do__load(filename) -.fi -.SS "def cmd2::Cmd::do_EOF (self, arg)" -.PP -Definition at line 937 of file cmd2\&.py'\&. -.PP -References _STOP_SCRIPT_NO_EXIT\&. -.PP -.nf -937 -938 def do_EOF(self, arg): - return self\&._STOP_SCRIPT_NO_EXIT # End of script; should not exit app -.fi -.SS "def cmd2::Cmd::do_help (self, arg)" -.PP -Definition at line 457 of file cmd2\&.py'\&. -.PP -References func_named(), and stdout\&. -.PP -.nf -457 -458 def do_help(self, arg): -459 if arg: -460 funcname = self\&.func_named(arg) -461 if funcname: -462 fn = getattr(self, funcname) -463 try: -464 fn\&.optionParser\&.print_help(file=self\&.stdout) -465 except AttributeError: -466 cmd\&.Cmd\&.do_help(self, funcname[3:]) -467 else: -468 cmd\&.Cmd\&.do_help(self, arg) - -.fi -.SS "def cmd2::Cmd::do_history (self, arg, opts)".PP -.nf -history [arg]: lists past commands issued - -| no arg: list all -| arg is integer: list one history item, by index -| arg is string: string search -| arg is /enclosed in forward-slashes/: regular expression search -.fi -.PP - -.PP -Definition at line 1083 of file cmd2\&.py'\&. -.PP -References history, and poutput()\&. -.PP -.nf -1083 -1084 def do_history(self, arg, opts): -1085 '''history [arg]: lists past commands issued -1086 -1087 | no arg: list all -1088 | arg is integer: list one history item, by index -1089 | arg is string: string search -1090 | arg is /enclosed in forward-slashes/: regular expression search -1091 ''' -1092 if arg: -1093 history = self\&.history\&.get(arg) -1094 else: -1095 history = self\&.history -1096 for hi in history: -1097 if opts\&.script: -1098 self\&.poutput(hi) -1099 else: - self\&.stdout\&.write(hi\&.pr()) -.fi -.SS "def cmd2::Cmd::do_list (self, arg)".PP -.nf -list [arg]: lists last command issued - -no arg -> list most recent command -arg is integer -> list one history item, by index -a..b, a:b, a:, ..b -> list spans from a (or start) to b (or end) -arg is string -> list all commands matching string search -arg is /enclosed in forward-slashes/ -> regular expression search -.fi -.PP - -.PP -Definition at line 1108 of file cmd2\&.py'\&. -.PP -References poutput()\&. -.PP -.nf -1108 -1109 def do_list(self, arg): -1110 '''list [arg]: lists last command issued -1111 -1112 no arg -> list most recent command -1113 arg is integer -> list one history item, by index -1114 a\&.\&.b, a:b, a:, \&.\&.b -> list spans from a (or start) to b (or end) -1115 arg is string -> list all commands matching string search -1116 arg is /enclosed in forward-slashes/ -> regular expression search -1117 ''' -1118 try: -1119 history = self\&.history\&.span(arg or '-1') -1120 except IndexError: -1121 history = self\&.history\&.search(arg) -1122 for hi in history: -1123 self\&.poutput(hi\&.pr()) - -.fi -.SS "def cmd2::Cmd::do_load (self, arg = \fCNone\fP)".PP -.nf -Runs script of command(s) from a file or URL..fi -.PP - -.PP -Definition at line 1218 of file cmd2\&.py'\&. -.PP -.nf -1218 -1219 def do_load(self, arg=None): -1220 '''Runs script of command(s) from a file or URL\&.''' -1221 if arg is None: -1222 targetname = self\&.default_file_name -1223 else: -1224 arg = arg\&.split(None, 1) -1225 targetname, args = arg[0], (arg[1:] or [''])[0]\&.strip() -1226 try: -1227 target = self\&.read_file_or_url(targetname) -1228 except IOError, e: -1229 self\&.perror('Problem accessing script from %s: \n%s' % (targetname, e)) -1230 return -1231 keepstate = Statekeeper(self, ('stdin','use_rawinput','prompt', -1232 'continuation_prompt','current_script_dir')) -1233 self\&.stdin = target -1234 self\&.use_rawinput = False -1235 self\&.prompt = self\&.continuation_prompt = '' -1236 self\&.current_script_dir = os\&.path\&.split(targetname)[0] -1237 stop = self\&._cmdloop() -1238 self\&.stdin\&.close() -1239 keepstate\&.restore() -1240 self\&.lastcmd = '' - return stop and (stop != self\&._STOP_SCRIPT_NO_EXIT) -.fi -.SS "def cmd2::Cmd::do_pause (self, arg)" -.PP -Definition at line 1031 of file cmd2\&.py'\&. -.PP -.nf -1031 -1032 def do_pause(self, arg): -1033 'Displays the specified text then waits for the user to press RETURN\&.' -1034 raw_input(arg + '\n') - -.fi -.SS "def cmd2::Cmd::do_py (self, arg)".PP -.nf - -py <command>: Executes a Python command. -py: Enters interactive Python mode. -End with ``Ctrl-D`` (Unix) / ``Ctrl-Z`` (Windows), ``quit()``, '`exit()``. -Non-python commands can be issued with ``cmd("your command")``. -Run python code from external files with ``run("filename.py")`` -.fi -.PP - -.PP -Definition at line 1039 of file cmd2\&.py'\&. -.PP -References do_py(), locals_in_py, onecmd_plus_hooks(), cmd2::options(), perror(), pystate, stdin, and stdout\&. -.PP -Referenced by do_py()\&. -.PP -.nf -1039 -1040 def do_py(self, arg): -1041 ''' -1042 py <command>: Executes a Python command\&. -1043 py: Enters interactive Python mode\&. -1044 End with ``Ctrl-D`` (Unix) / ``Ctrl-Z`` (Windows), ``quit()``, '`exit()``\&. -1045 Non-python commands can be issued with ``cmd('your command')``\&. -1046 Run python code from external files with ``run('filename\&.py')`` -1047 ''' -1048 self\&.pystate['self'] = self -1049 arg = arg\&.parsed\&.raw[2:]\&.strip() -1050 localvars = (self\&.locals_in_py and self\&.pystate) or {} -1051 interp = InteractiveConsole(locals=localvars) -1052 interp\&.runcode('import sys, os;sys\&.path\&.insert(0, os\&.getcwd())') -1053 if arg\&.strip(): -1054 interp\&.runcode(arg) -1055 else: -1056 def quit(): -1057 raise EmbeddedConsoleExit -1058 def onecmd_plus_hooks(arg): -1059 return self\&.onecmd_plus_hooks(arg + '\n') -1060 def run(arg): -1061 try: -1062 file = open(arg) -1063 interp\&.runcode(file\&.read()) -1064 file\&.close() -1065 except IOError, e: -1066 self\&.perror(e) -1067 self\&.pystate['quit'] = quit -1068 self\&.pystate['exit'] = quit -1069 self\&.pystate['cmd'] = onecmd_plus_hooks -1070 self\&.pystate['run'] = run -1071 try: -1072 cprt = 'Type 'help', 'copyright', 'credits' or 'license' for more information\&.' -1073 keepstate = Statekeeper(sys, ('stdin','stdout')) -1074 sys\&.stdout = self\&.stdout -1075 sys\&.stdin = self\&.stdin -1076 interp\&.interact(banner= 'Python %s on %s\n%s\n(%s)\n%s' % -1077 (sys\&.version, sys\&.platform, cprt, self\&.__class__\&.__name__, self\&.do_py\&.__doc__)) -1078 except EmbeddedConsoleExit: -1079 pass -1080 keepstate\&.restore() - -.fi -.SS "def cmd2::Cmd::do_quit (self, arg)" -.PP -Reimplemented in \fBpirate6::Pirate\fP, \fBpirate7::Pirate\fP, and \fBpirate8::Pirate\fP'\&. -.PP -Definition at line 941 of file cmd2\&.py'\&. -.PP -References _STOP_AND_EXIT\&. -.PP -.nf -941 -942 def do_quit(self, arg): - return self\&._STOP_AND_EXIT -.fi -.SS "def cmd2::Cmd::do_run (self, arg)".PP -.nf -run [arg]: re-runs an earlier command - -no arg -> run most recent command -arg is integer -> run one history item, by index -arg is string -> run most recent command by string search -arg is /enclosed in forward-slashes/ -> run most recent by regex -.fi -.PP - -.PP -Definition at line 1243 of file cmd2\&.py'\&. -.PP -References last_matching(), onecmd_plus_hooks(), and pfeedback()\&. -.PP -.nf -1243 -1244 def do_run(self, arg): -1245 '''run [arg]: re-runs an earlier command -1246 -1247 no arg -> run most recent command -1248 arg is integer -> run one history item, by index -1249 arg is string -> run most recent command by string search -1250 arg is /enclosed in forward-slashes/ -> run most recent by regex -1251 ''' -1252 'run [N]: runs the SQL that was run N commands ago' -1253 runme = self\&.last_matching(arg) -1254 self\&.pfeedback(runme) -1255 if runme: - stop = self\&.onecmd_plus_hooks(runme) -.fi -.SS "def cmd2::Cmd::do_save (self, arg)".PP -.nf -`save [N] [filename.ext]` - -Saves command from history to file. - -| N => Number of command (from history), or `*`; -| most recent command if omitted.fi -.PP - -.PP -Definition at line 1160 of file cmd2\&.py'\&. -.PP -References default_file_name, do_save(), history, perror(), and pfeedback()\&. -.PP -Referenced by do_save()\&. -.PP -.nf -1160 -1161 def do_save(self, arg): -1162 '''`save [N] [filename\&.ext]` -1163 -1164 Saves command from history to file\&. -1165 -1166 | N => Number of command (from history), or `*`; -1167 | most recent command if omitted''' -1168 -1169 try: -1170 args = self\&.saveparser\&.parseString(arg) -1171 except pyparsing\&.ParseException: -1172 self\&.perror('Could not understand save target %s' % arg) -1173 raise SyntaxError(self\&.do_save\&.__doc__) -1174 fname = args\&.fname or self\&.default_file_name -1175 if args\&.idx == '*': -1176 saveme = '\n\n'\&.join(self\&.history[:]) -1177 elif args\&.idx: -1178 saveme = self\&.history[int(args\&.idx)-1] -1179 else: -1180 saveme = self\&.history[-1] -1181 try: -1182 f = open(os\&.path\&.expanduser(fname), 'w') -1183 f\&.write(saveme) -1184 f\&.close() -1185 self\&.pfeedback('Saved to %s' % (fname)) -1186 except Exception, e: -1187 self\&.perror('Error saving %s' % (fname)) -1188 raise - -.fi -.SS "def cmd2::Cmd::do_set (self, arg)".PP -.nf - -Sets a cmd2 parameter. Accepts abbreviated parameter names so long -as there is no ambiguity. Call without arguments for a list of -settable parameters with their values..fi -.PP - -.PP -Definition at line 1000 of file cmd2\&.py'\&. -.PP -References cmd2::cast(), do_show(), and settable\&. -.PP -.nf -1000 -1001 def do_set(self, arg): -1002 ''' -1003 Sets a cmd2 parameter\&. Accepts abbreviated parameter names so long -1004 as there is no ambiguity\&. Call without arguments for a list of -1005 settable parameters with their values\&.''' -1006 try: -1007 statement, paramName, val = arg\&.parsed\&.raw\&.split(None, 2) -1008 val = val\&.strip() -1009 paramName = paramName\&.strip()\&.lower() -1010 if paramName not in self\&.settable: -1011 hits = [p for p in self\&.settable if p\&.startswith(paramName)] -1012 if len(hits) == 1: -1013 paramName = hits[0] -1014 else: -1015 return self\&.do_show(paramName) -1016 currentVal = getattr(self, paramName) -1017 if (val[0] == val[-1]) and val[0] in (''', '''): -1018 val = val[1:-1] -1019 else: -1020 val = cast(currentVal, val) -1021 setattr(self, paramName, val) -1022 self\&.stdout\&.write('%s - was: %s\nnow: %s\n' % (paramName, currentVal, val)) -1023 if currentVal != val: -1024 try: -1025 onchange_hook = getattr(self, '_onchange_%s' % paramName) -1026 onchange_hook(old=currentVal, new=val) -1027 except AttributeError: -1028 pass -1029 except (ValueError, AttributeError, NotSettableError), e: -1030 self\&.do_show(arg) - -.fi -.SS "def cmd2::Cmd::do_shell (self, arg)" -.PP -Definition at line 1035 of file cmd2\&.py'\&. -.PP -.nf -1035 -1036 def do_shell(self, arg): -1037 'execute a command as if at the OS prompt\&.' -1038 os\&.system(arg) - -.fi -.SS "def cmd2::Cmd::do_shortcuts (self, args)".PP -.nf -Lists single-key shortcuts available..fi -.PP - -.PP -Definition at line 479 of file cmd2\&.py'\&. -.PP -References shortcuts\&. -.PP -.nf -479 -480 def do_shortcuts(self, args): -481 '''Lists single-key shortcuts available\&.''' -482 result = '\n'\&.join('%s: %s' % (sc[0], sc[1]) for sc in sorted(self\&.shortcuts)) -483 self\&.stdout\&.write('Single-key shortcuts for other commands:\n%s\n' % (result)) - -.fi -.SS "def cmd2::Cmd::do_show (self, arg, opts)".PP -.nf -Shows value of a parameter..fi -.PP - -.PP -Definition at line 982 of file cmd2\&.py'\&. -.PP -References cmd2::ljust(), poutput(), and settable\&. -.PP -Referenced by do_set()\&. -.PP -.nf -982 -983 def do_show(self, arg, opts): -984 '''Shows value of a parameter\&.''' -985 param = arg\&.strip()\&.lower() -986 result = {} -987 maxlen = 0 -988 for p in self\&.settable: -989 if (not param) or p\&.startswith(param): -990 result[p] = '%s: %s' % (p, str(getattr(self, p))) -991 maxlen = max(maxlen, len(result[p])) -992 if result: -993 for p in sorted(result): -994 if opts\&.long: -995 self\&.poutput('%s # %s' % (result[p]\&.ljust(maxlen), self\&.settable[p])) -996 else: -997 self\&.poutput(result[p]) -998 else: -999 raise NotImplementedError('Parameter '%s' not supported (type 'show' for list of parameters)\&.' % param) - -.fi -.SS "def cmd2::Cmd::fileimport (self, statement, source)" -.PP -Definition at line 1258 of file cmd2\&.py'\&. -.PP -.nf -1258 -1259 def fileimport(self, statement, source): -1260 try: -1261 f = open(os\&.path\&.expanduser(source)) -1262 except IOError: -1263 self\&.stdout\&.write('Couldn't read from file %s\n' % source) -1264 return '' -1265 data = f\&.read() -1266 f\&.close() -1267 return data - -.fi -.SS "def cmd2::Cmd::func_named (self, arg)" -.PP -Definition at line 755 of file cmd2\&.py'\&. -.PP -References abbrev, and keywords\&. -.PP -Referenced by do_help()\&. -.PP -.nf -755 -756 def func_named(self, arg): -757 result = None -758 target = 'do_' + arg -759 if target in dir(self): -760 result = target -761 else: -762 if self\&.abbrev: # accept shortened versions of commands -763 funcs = [fname for fname in self\&.keywords if fname\&.startswith(arg)] -764 if len(funcs) == 1: -765 result = 'do_' + funcs[0] - return result -.fi -.SS "def cmd2::Cmd::last_matching (self, arg)" -.PP -Definition at line 1100 of file cmd2\&.py'\&. -.PP -References history\&. -.PP -Referenced by do_ed(), and do_run()\&. -.PP -.nf -1100 -1101 def last_matching(self, arg): -1102 try: -1103 if arg: -1104 return self\&.history\&.get(arg)[-1] -1105 else: -1106 return self\&.history[-1] -1107 except IndexError: - return None -.fi -.SS "def cmd2::Cmd::onecmd (self, line)".PP -.nf -Interpret the argument as though it had been typed in response -to the prompt. - -This may be overridden, but should not normally need to be; -see the precmd() and postcmd() methods for useful execution hooks. -The return value is a flag indicating whether interpretation of -commands by the interpreter should stop. - -This (`cmd2`) version of `onecmd` already override's `cmd`'s `onecmd`. - -.fi -.PP - -.PP -Definition at line 844 of file cmd2\&.py'\&. -.PP -Referenced by onecmd_plus_hooks()\&. -.PP -.nf -844 -845 def onecmd(self, line): -846 '''Interpret the argument as though it had been typed in response -847 to the prompt\&. -848 -849 This may be overridden, but should not normally need to be; -850 see the precmd() and postcmd() methods for useful execution hooks\&. -851 The return value is a flag indicating whether interpretation of -852 commands by the interpreter should stop\&. -853 -854 This (`cmd2`) version of `onecmd` already override's `cmd`'s `onecmd`\&. -855 -856 ''' -857 statement = self\&.parsed(line) -858 self\&.lastcmd = statement\&.parsed\&.raw -859 funcname = self\&.func_named(statement\&.parsed\&.command) -860 if not funcname: -861 return self\&._default(statement) -862 try: -863 func = getattr(self, funcname) -864 except AttributeError: -865 return self\&._default(statement) -866 stop = func(statement) -867 return stop - -.fi -.SS "def cmd2::Cmd::onecmd_plus_hooks (self, line)" -.PP -Definition at line 766 of file cmd2\&.py'\&. -.PP -References complete_statement(), excludeFromHistory, onecmd(), perror(), pfeedback(), pirate3::Pirate::postcmd(), pirate4::Pirate::postcmd(), pirate5::Pirate::postcmd(), pirate7::Pirate::postcmd(), pirate8::Pirate::postcmd(), pirate6::Pirate::postcmd(), postparsing_postcmd(), postparsing_precmd(), pirate3::Pirate::precmd(), pirate4::Pirate::precmd(), pirate5::Pirate::precmd(), pirate7::Pirate::precmd(), pirate8::Pirate::precmd(), pirate6::Pirate::precmd(), redirect_output(), restore_output(), and timing\&. -.PP -Referenced by do_py(), do_run(), and run_commands_at_invocation()\&. -.PP -.nf -766 -767 def onecmd_plus_hooks(self, line): -768 # The outermost level of try/finally nesting can be condensed once -769 # Python 2\&.4 support can be dropped\&. -770 stop = 0 -771 try: -772 try: -773 statement = self\&.complete_statement(line) -774 (stop, statement) = self\&.postparsing_precmd(statement) -775 if stop: -776 return self\&.postparsing_postcmd(stop) -777 if statement\&.parsed\&.command not in self\&.excludeFromHistory: -778 self\&.history\&.append(statement\&.parsed\&.raw) -779 try: -780 self\&.redirect_output(statement) -781 timestart = datetime\&.datetime\&.now() -782 statement = self\&.precmd(statement) -783 stop = self\&.onecmd(statement) -784 stop = self\&.postcmd(stop, statement) -785 if self\&.timing: -786 self\&.pfeedback('Elapsed: %s' % str(datetime\&.datetime\&.now() - timestart)) -787 finally: -788 self\&.restore_output(statement) -789 except EmptyStatement: -790 return 0 -791 except Exception, e: -792 self\&.perror(str(e), statement) -793 finally: - return self\&.postparsing_postcmd(stop) -.fi -.SS "def cmd2::Cmd::parsed (self, raw, kwargs)" -.PP -Definition at line 726 of file cmd2\&.py'\&. -.PP -References parsed(), postparse(), preparse(), and shortcuts\&. -.PP -Referenced by complete_statement(), cmd2::ParsedString::full_parsed_statement(), parsed(), and cmd2::ParsedString::with_args_replaced()\&. -.PP -.nf -726 -727 def parsed(self, raw, **kwargs): -728 if isinstance(raw, ParsedString): -729 p = raw -730 else: -731 # preparse is an overridable hook; default makes no changes -732 s = self\&.preparse(raw, **kwargs) -733 s = self\&.inputParser\&.transformString(s\&.lstrip()) -734 s = self\&.commentGrammars\&.transformString(s) -735 for (shortcut, expansion) in self\&.shortcuts: -736 if s\&.lower()\&.startswith(shortcut): -737 s = s\&.replace(shortcut, expansion + ' ', 1) -738 break -739 result = self\&.parser\&.parseString(s) -740 result['raw'] = raw -741 result['command'] = result\&.multilineCommand or result\&.command -742 result = self\&.postparse(result) -743 p = ParsedString(result\&.args) -744 p\&.parsed = result -745 p\&.parser = self\&.parsed -746 for (key, val) in kwargs\&.items(): -747 p\&.parsed[key] = val -748 return p - -.fi -.SS "def cmd2::Cmd::perror (self, errmsg, statement = \fCNone\fP)" -.PP -Definition at line 404 of file cmd2\&.py'\&. -.PP -References debug\&. -.PP -Referenced by do_py(), do_save(), and onecmd_plus_hooks()\&. -.PP -.nf -404 -405 def perror(self, errmsg, statement=None): -406 if self\&.debug: -407 traceback\&.print_exc() - print (str(errmsg)) -.fi -.SS "def cmd2::Cmd::pfeedback (self, msg)".PP -.nf -For printing nonessential feedback. Can be silenced with `quiet`. - Inclusion in redirected output is controlled by `feedback_to_output`..fi -.PP - -.PP -Definition at line 408 of file cmd2\&.py'\&. -.PP -References feedback_to_output, poutput(), and quiet\&. -.PP -Referenced by do_run(), do_save(), and onecmd_plus_hooks()\&. -.PP -.nf -408 -409 def pfeedback(self, msg): -410 '''For printing nonessential feedback\&. Can be silenced with `quiet`\&. -411 Inclusion in redirected output is controlled by `feedback_to_output`\&.''' -412 if not self\&.quiet: -413 if self\&.feedback_to_output: -414 self\&.poutput(msg) -415 else: - print (msg) -.fi -.SS "def cmd2::Cmd::postparse (self, parseResult)" -.PP -Definition at line 723 of file cmd2\&.py'\&. -.PP -Referenced by parsed()\&. -.PP -.nf -723 -724 def postparse(self, parseResult): -725 return parseResult - -.fi -.SS "def cmd2::Cmd::postparsing_postcmd (self, stop)" -.PP -Definition at line 752 of file cmd2\&.py'\&. -.PP -Referenced by _default(), and onecmd_plus_hooks()\&. -.PP -.nf -752 -753 def postparsing_postcmd(self, stop): -754 return stop - -.fi -.SS "def cmd2::Cmd::postparsing_precmd (self, statement)" -.PP -Definition at line 749 of file cmd2\&.py'\&. -.PP -Referenced by onecmd_plus_hooks()\&. -.PP -.nf -749 -750 def postparsing_precmd(self, statement): -751 stop = 0 - return stop, statement -.fi -.SS "def cmd2::Cmd::poutput (self, msg)".PP -.nf -Convenient shortcut for self.stdout.write(); adds newline if necessary..fi -.PP - -.PP -Definition at line 398 of file cmd2\&.py'\&. -.PP -Referenced by do_history(), do_list(), do_show(), pfeedback(), and select()\&. -.PP -.nf -398 -399 def poutput(self, msg): -400 '''Convenient shortcut for self\&.stdout\&.write(); adds newline if necessary\&.''' -401 if msg: -402 self\&.stdout\&.write(msg) -403 if msg[-1] != '\n': - self\&.stdout\&.write('\n') -.fi -.SS "def cmd2::Cmd::preparse (self, raw, kwargs)" -.PP -Definition at line 721 of file cmd2\&.py'\&. -.PP -Referenced by parsed()\&. -.PP -.nf -721 -722 def preparse(self, raw, **kwargs): - return raw -.fi -.SS "def cmd2::Cmd::pseudo_raw_input (self, prompt)".PP -.nf -copied from cmd's cmdloop; like raw_input, but accounts for changed stdin, stdout.fi -.PP - -.PP -Definition at line 876 of file cmd2\&.py'\&. -.PP -References use_rawinput\&. -.PP -Referenced by complete_statement()\&. -.PP -.nf -876 -877 def pseudo_raw_input(self, prompt): -878 '''copied from cmd's cmdloop; like raw_input, but accounts for changed stdin, stdout''' -879 -880 if self\&.use_rawinput: -881 try: -882 line = raw_input(prompt) -883 except EOFError: -884 line = 'EOF' -885 else: -886 self\&.stdout\&.write(prompt) -887 self\&.stdout\&.flush() -888 line = self\&.stdin\&.readline() -889 if not len(line): -890 line = 'EOF' -891 else: -892 if line[-1] == '\n': # this was always true in Cmd -893 line = line[:-1] -894 return line - -.fi -.SS "def cmd2::Cmd::read_file_or_url (self, fname)" -.PP -Definition at line 1189 of file cmd2\&.py'\&. -.PP -References defaultExtension\&. -.PP -.nf -1189 -1190 def read_file_or_url(self, fname): -1191 # TODO: not working on localhost -1192 if isinstance(fname, file): -1193 result = open(fname, 'r') -1194 else: -1195 match = self\&.urlre\&.match(fname) -1196 if match: -1197 result = urllib\&.urlopen(match\&.group(1)) -1198 else: -1199 fname = os\&.path\&.expanduser(fname) -1200 try: -1201 result = open(os\&.path\&.expanduser(fname), 'r') -1202 except IOError: -1203 result = open('%s\&.%s' % (os\&.path\&.expanduser(fname), -1204 self\&.defaultExtension), 'r') -1205 return result - -.fi -.SS "def cmd2::Cmd::redirect_output (self, statement)" -.PP -Definition at line 809 of file cmd2\&.py'\&. -.PP -References cmd2::get_paste_buffer(), kept_state, kept_sys, redirect, redirector, and stdout\&. -.PP -Referenced by onecmd_plus_hooks()\&. -.PP -.nf -809 -810 def redirect_output(self, statement): -811 if statement\&.parsed\&.pipeTo: -812 self\&.kept_state = Statekeeper(self, ('stdout',)) -813 self\&.kept_sys = Statekeeper(sys, ('stdout',)) -814 self\&.redirect = subprocess\&.Popen(statement\&.parsed\&.pipeTo, shell=True, stdout=subprocess\&.PIPE, stdin=subprocess\&.PIPE) -815 sys\&.stdout = self\&.stdout = self\&.redirect\&.stdin -816 elif statement\&.parsed\&.output: -817 if (not statement\&.parsed\&.outputTo) and (not can_clip): -818 raise EnvironmentError('Cannot redirect to paste buffer; install ``xclip`` and re-run to enable') -819 self\&.kept_state = Statekeeper(self, ('stdout',)) -820 self\&.kept_sys = Statekeeper(sys, ('stdout',)) -821 if statement\&.parsed\&.outputTo: -822 mode = 'w' -823 if statement\&.parsed\&.output == 2 * self\&.redirector: -824 mode = 'a' -825 sys\&.stdout = self\&.stdout = open(os\&.path\&.expanduser(statement\&.parsed\&.outputTo), mode) -826 else: -827 sys\&.stdout = self\&.stdout = tempfile\&.TemporaryFile(mode='w+') -828 if statement\&.parsed\&.output == '>>': -829 self\&.stdout\&.write(get_paste_buffer()) - -.fi -.SS "def cmd2::Cmd::restore_output (self, statement)" -.PP -Definition at line 830 of file cmd2\&.py'\&. -.PP -References kept_state, and cmd2::write_to_paste_buffer\&. -.PP -Referenced by onecmd_plus_hooks()\&. -.PP -.nf -830 -831 def restore_output(self, statement): -832 if self\&.kept_state: -833 if statement\&.parsed\&.output: -834 if not statement\&.parsed\&.outputTo: -835 self\&.stdout\&.seek(0) -836 write_to_paste_buffer(self\&.stdout\&.read()) -837 elif statement\&.parsed\&.pipeTo: -838 for result in self\&.redirect\&.communicate(): -839 self\&.kept_state\&.stdout\&.write(result or '') -840 self\&.stdout\&.close() -841 self\&.kept_state\&.restore() -842 self\&.kept_sys\&.restore() -843 self\&.kept_state = None - -.fi -.SS "def cmd2::Cmd::run_commands_at_invocation (self, callargs)" -.PP -Definition at line 1278 of file cmd2\&.py'\&. -.PP -References _STOP_AND_EXIT, and onecmd_plus_hooks()\&. -.PP -Referenced by cmdloop()\&. -.PP -.nf -1278 -1279 def run_commands_at_invocation(self, callargs): -1280 for initial_command in callargs: -1281 if self\&.onecmd_plus_hooks(initial_command + '\n'): -1282 return self\&._STOP_AND_EXIT - -.fi -.SS "def cmd2::Cmd::runTranscriptTests (self, callargs)" -.PP -Definition at line 1268 of file cmd2\&.py'\&. -.PP -Referenced by cmdloop()\&. -.PP -.nf -1268 -1269 def runTranscriptTests(self, callargs): -1270 class TestMyAppCase(Cmd2TestCase): -1271 CmdApp = self\&.__class__ -1272 self\&.__class__\&.testfiles = callargs -1273 sys\&.argv = [sys\&.argv[0]] # the --test argument upsets unittest\&.main() -1274 testcase = TestMyAppCase() -1275 runner = unittest\&.TextTestRunner() -1276 result = runner\&.run(testcase) -1277 result\&.printErrors() - -.fi -.SS "def cmd2::Cmd::select (self, options, prompt = \fC'Your choice? '\fP)".PP -.nf -Presents a numbered menu to the user. Modelled after - the bash shell's SELECT. Returns the item chosen. - - Argument ``options`` can be: - - | a single string -> will be split into one-word options - | a list of strings -> will be offered as options - | a list of tuples -> interpreted as (value, text), so - that the return value can differ from - the text advertised to the user .fi -.PP - -.PP -Definition at line 946 of file cmd2\&.py'\&. -.PP -References cmd2::options(), and poutput()\&. -.PP -.nf -946 -947 def select(self, options, prompt='Your choice? '): -948 '''Presents a numbered menu to the user\&. Modelled after -949 the bash shell's SELECT\&. Returns the item chosen\&. -950 -951 Argument ``options`` can be: -952 -953 | a single string -> will be split into one-word options -954 | a list of strings -> will be offered as options -955 | a list of tuples -> interpreted as (value, text), so -956 that the return value can differ from -957 the text advertised to the user ''' -958 if isinstance(options, basestring): -959 options = zip(options\&.split(), options\&.split()) -960 fulloptions = [] -961 for opt in options: -962 if isinstance(opt, basestring): -963 fulloptions\&.append((opt, opt)) -964 else: -965 try: -966 fulloptions\&.append((opt[0], opt[1])) -967 except IndexError: -968 fulloptions\&.append((opt[0], opt[0])) -969 for (idx, (value, text)) in enumerate(fulloptions): -970 self\&.poutput(' %2d\&. %s\n' % (idx+1, text)) -971 while True: -972 response = raw_input(prompt) -973 try: -974 response = int(response) -975 result = fulloptions[response - 1][0] -976 break -977 except ValueError: -978 pass # loop and ask again -979 return result - -.fi -.SH "Member Data Documentation" -.PP -.SS "\fBcmd2::Cmd::_STOP_AND_EXIT\fP = True\fC [static, private]\fP" -.PP -Definition at line 416 of file cmd2\&.py'\&. -.PP -Referenced by do_quit(), and run_commands_at_invocation()\&. -.SS "int \fBcmd2::Cmd::_STOP_SCRIPT_NO_EXIT\fP = 999\fC [static, private]\fP" -.PP -Definition at line 417 of file cmd2\&.py'\&. -.PP -Referenced by do_EOF()\&. -.SS "\fBcmd2::Cmd::abbrev\fP = True\fC [static]\fP" -.PP -Definition at line 374 of file cmd2\&.py'\&. -.PP -Referenced by func_named()\&. -.SS "\fBcmd2::Cmd::blankLinesAllowed\fP = False\fC [static]\fP" -.PP -Definition at line 490 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::blankLineTerminationParser\fP" -.PP -Definition at line 667 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::blankLineTerminator\fP" -.PP -Definition at line 667 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::case_insensitive\fP = True\fC [static]\fP" -.PP -Definition at line 363 of file cmd2\&.py'\&. -.PP -Referenced by do_cmdenvironment()\&. -.SS "dictionary \fBcmd2::Cmd::colorcodes\fP\fC [static]\fP"\fBInitial value:\fP -.PP -.nf -{'bold':{True:'\x1b[1m',False:'\x1b[22m'}, - 'cyan':{True:'\x1b[36m',False:'\x1b[39m'}, - 'blue':{True:'\x1b[34m',False:'\x1b[39m'}, - 'red':{True:'\x1b[31m',False:'\x1b[39m'}, - 'magenta':{True:'\x1b[35m',False:'\x1b[39m'}, - 'green':{True:'\x1b[32m',False:'\x1b[39m'}, - 'underline':{True:'\x1b[4m',False:'\x1b[24m'}} -.fi -.PP -Definition at line 427 of file cmd2\&.py'\&. -.SS "tuple \fBcmd2::Cmd::colors\fP = (platform\&.system() != 'Windows')\fC [static]\fP" -.PP -Definition at line 434 of file cmd2\&.py'\&. -.SS "tuple \fBcmd2::Cmd::commentGrammars\fP = pyparsing\&.Or([pyparsing\&.pythonStyleComment, pyparsing\&.cStyleComment])\fC [static]\fP" -.PP -Definition at line 485 of file cmd2\&.py'\&. -.PP -Referenced by complete_statement()\&. -.SS "tuple \fBcmd2::Cmd::commentInProgress\fP = pyparsing\&.Literal('/*')\fC [static]\fP" -.PP -Definition at line 487 of file cmd2\&.py'\&. -.SS "string \fBcmd2::Cmd::continuation_prompt\fP = '> '\fC [static]\fP" -.PP -Definition at line 364 of file cmd2\&.py'\&. -.PP -Referenced by complete_statement()\&. -.SS "\fBcmd2::Cmd::continuation_prompt\fP" -.PP -Definition at line 1218 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::current_script_dir\fP = None\fC [static]\fP" -.PP -Definition at line 375 of file cmd2\&.py'\&. -.PP -Referenced by do__relative_load()\&. -.SS "\fBcmd2::Cmd::debug\fP = False\fC [static]\fP" -.PP -Definition at line 379 of file cmd2\&.py'\&. -.PP -Referenced by perror()\&. -.SS "string \fBcmd2::Cmd::default_file_name\fP = 'command\&.txt'\fC [static]\fP" -.PP -Definition at line 373 of file cmd2\&.py'\&. -.PP -Referenced by do_ed(), and do_save()\&. -.SS "\fBcmd2::Cmd::default_to_shell\fP = False\fC [static]\fP" -.PP -Reimplemented in \fBpirate7::Pirate\fP, and \fBpirate8::Pirate\fP'\&. -.PP -Definition at line 370 of file cmd2\&.py'\&. -.PP -Referenced by _default()\&. -.SS "string \fBcmd2::Cmd::defaultExtension\fP = 'txt'\fC [static]\fP" -.PP -Definition at line 372 of file cmd2\&.py'\&. -.PP -Referenced by read_file_or_url()\&. -.SS "\fBcmd2::Cmd::do__load\fP = do_load\fC [static]\fP" -.PP -Definition at line 1241 of file cmd2\&.py'\&. -.PP -Referenced by do__relative_load(), and do_ed()\&. -.SS "\fBcmd2::Cmd::do_edit\fP = do_ed\fC [static]\fP" -.PP -Definition at line 1155 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::do_eof\fP = do_EOF\fC [static]\fP" -.PP -Definition at line 939 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::do_exit\fP = do_quit\fC [static]\fP" -.PP -Definition at line 943 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::do_hi\fP = do_history\fC [static]\fP" -.PP -Definition at line 1124 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::do_l\fP = do_list\fC [static]\fP" -.PP -Definition at line 1125 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::do_li\fP = do_list\fC [static]\fP" -.PP -Definition at line 1126 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::do_q\fP = do_quit\fC [static]\fP" -.PP -Definition at line 944 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::do_r\fP = do_run\fC [static]\fP" -.PP -Definition at line 1256 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::echo\fP = False\fC [static]\fP" -.PP -Definition at line 362 of file cmd2\&.py'\&. -.SS "tuple \fBcmd2::Cmd::editor\fP = os\&.environ\&.get('EDITOR')\fC [static]\fP" -.PP -Definition at line 418 of file cmd2\&.py'\&. -.PP -Referenced by do_ed()\&. -.SS "string \fBcmd2::Cmd::editor\fP = 'notepad'\fC [static]\fP" -.PP -Definition at line 421 of file cmd2\&.py'\&. -.SS "string \fBcmd2::Cmd::excludeFromHistory\fP = '''run r list l \fBhistory\fP hi ed edit li eof'''\fC [static]\fP" -.PP -Definition at line 369 of file cmd2\&.py'\&. -.PP -Referenced by onecmd_plus_hooks()\&. -.SS "\fBcmd2::Cmd::feedback_to_output\fP = False\fC [static]\fP" -.PP -Definition at line 377 of file cmd2\&.py'\&. -.PP -Referenced by pfeedback()\&. -.SS "string \fBcmd2::Cmd::help\fP = 'describe function of parameter'\fC [static]\fP" -.PP -Reimplemented in \fBpirate8::Pirate\fP'\&. -.PP -Definition at line 981 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::history\fP" -.PP -Definition at line 469 of file cmd2\&.py'\&. -.PP -Referenced by do_ed(), do_history(), do_save(), and last_matching()\&. -.SS "\fBcmd2::Cmd::initial_stdout\fP" -.PP -Definition at line 469 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::inputParser\fP" -.PP -Definition at line 667 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::intro\fP" -.PP -Definition at line 898 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::kept_state\fP = None\fC [static]\fP" -.PP -Definition at line 381 of file cmd2\&.py'\&. -.PP -Referenced by redirect_output(), and restore_output()\&. -.SS "\fBcmd2::Cmd::kept_sys\fP" -.PP -Definition at line 809 of file cmd2\&.py'\&. -.PP -Referenced by redirect_output()\&. -.SS "\fBcmd2::Cmd::keywords\fP" -.PP -Definition at line 469 of file cmd2\&.py'\&. -.PP -Referenced by func_named()\&. -.SS "\fBcmd2::Cmd::lastcmd\fP" -.PP -Definition at line 854 of file cmd2\&.py'\&. -.SS "string \fBcmd2::Cmd::legalChars\fP = u'!#$%\&.:?@_'\fC [static]\fP" -.PP -Definition at line 367 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::locals_in_py\fP = True\fC [static]\fP" -.PP -Definition at line 380 of file cmd2\&.py'\&. -.PP -Referenced by do_py()\&. -.SS "\fBcmd2::Cmd::multilineCommand\fP" -.PP -Definition at line 667 of file cmd2\&.py'\&. -.SS "list \fBcmd2::Cmd::multilineCommands\fP = []\fC [static]\fP" -.PP -Reimplemented in \fBpirate7::Pirate\fP, \fBpirate8::Pirate\fP, and \fBexample::CmdLineApp\fP'\&. -.PP -Definition at line 491 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::multilineParser\fP" -.PP -Definition at line 667 of file cmd2\&.py'\&. -.SS "string \fBcmd2::Cmd::noSpecialParse\fP = 'set ed edit exit'\fC [static]\fP" -.PP -Definition at line 371 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::old_completer\fP" -.PP -Definition at line 898 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::parser\fP" -.PP -Definition at line 667 of file cmd2\&.py'\&. -.PP -Referenced by cmd2::ParsedString::full_parsed_statement(), and cmd2::ParsedString::with_args_replaced()\&. -.SS "tuple \fBcmd2::Cmd::prefixParser\fP = pyparsing\&.Empty()\fC [static]\fP" -.PP -Definition at line 484 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::prompt\fP" -.PP -Reimplemented in \fBpirate6::Pirate\fP, \fBpirate7::Pirate\fP, and \fBpirate8::Pirate\fP'\&. -.PP -Definition at line 1218 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::pystate\fP" -.PP -Definition at line 469 of file cmd2\&.py'\&. -.PP -Referenced by do_py()\&. -.SS "\fBcmd2::Cmd::quiet\fP = False\fC [static]\fP" -.PP -Definition at line 378 of file cmd2\&.py'\&. -.PP -Referenced by pfeedback()\&. -.SS "\fBcmd2::Cmd::redirect\fP" -.PP -Definition at line 809 of file cmd2\&.py'\&. -.PP -Referenced by redirect_output()\&. -.SS "string \fBcmd2::Cmd::redirector\fP = '>'\fC [static]\fP" -.PP -Reimplemented in \fBexample::CmdLineApp\fP'\&. -.PP -Definition at line 382 of file cmd2\&.py'\&. -.PP -Referenced by redirect_output()\&. -.SS "list \fBcmd2::Cmd::reserved_words\fP = []\fC [static]\fP" -.PP -Definition at line 376 of file cmd2\&.py'\&. -.SS "tuple \fBcmd2::Cmd::saveparser\fP\fC [static]\fP"\fBInitial value:\fP -.PP -.nf -(pyparsing\&.Optional(pyparsing\&.Word(pyparsing\&.nums)^'*')('idx') + - pyparsing\&.Optional(pyparsing\&.Word(legalChars + '/\\'))('fname') + - pyparsing\&.stringEnd) -.fi -.PP -Definition at line 1157 of file cmd2\&.py'\&. -.SS "tuple \fBcmd2::Cmd::settable\fP\fC [static]\fP"\fBInitial value:\fP -.PP -.nf -stubbornDict(''' - prompt - colors Colorized output (*nix only) - continuation_prompt On 2nd+ line of input - debug Show full error stack on error - default_file_name for ``save``, ``load``, etc\&. - editor Program used by ``edit`` - case_insensitive upper- and lower-case both OK - feedback_to_output include nonessentials in `|`, `>` results - quiet Don't print nonessential feedback - echo Echo command issued into output - timing Report execution times - abbrev Accept abbreviated commands - ''') -.fi -.PP -Reimplemented in \fBpirate7::Pirate\fP, and \fBpirate8::Pirate\fP'\&. -.PP -Definition at line 383 of file cmd2\&.py'\&. -.PP -Referenced by do_cmdenvironment(), do_set(), and do_show()\&. -.SS "dictionary \fBcmd2::Cmd::shortcuts\fP = {'?': '\fBhelp\fP', '!': 'shell', '@': 'load', '@@': '_relative_load'}\fC [static]\fP" -.PP -Definition at line 368 of file cmd2\&.py'\&. -.PP -Referenced by do_shortcuts(), and parsed()\&. -.SS "\fBcmd2::Cmd::shortcuts\fP" -.PP -Definition at line 469 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::singleLineParser\fP" -.PP -Definition at line 667 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::stdin\fP" -.PP -Definition at line 1218 of file cmd2\&.py'\&. -.PP -Referenced by do_py()\&. -.SS "\fBcmd2::Cmd::stdout\fP" -.PP -Definition at line 440 of file cmd2\&.py'\&. -.PP -Referenced by do_help(), do_py(), and redirect_output()\&. -.SS "list \fBcmd2::Cmd::terminators\fP = [';']\fC [static]\fP" -.PP -Reimplemented in \fBpirate7::Pirate\fP, and \fBpirate8::Pirate\fP'\&. -.PP -Definition at line 489 of file cmd2\&.py'\&. -.PP -Referenced by do_cmdenvironment()\&. -.SS "\fBcmd2::Cmd::timing\fP = False\fC [static]\fP" -.PP -Definition at line 365 of file cmd2\&.py'\&. -.PP -Referenced by onecmd_plus_hooks()\&. -.SS "tuple \fBcmd2::Cmd::urlre\fP = re\&.compile('(https?://[-\\\\w\\\\\&./]+)')\fC [static]\fP" -.PP -Definition at line 1217 of file cmd2\&.py'\&. -.SS "\fBcmd2::Cmd::use_rawinput\fP" -.PP -Definition at line 1218 of file cmd2\&.py'\&. -.PP -Referenced by pseudo_raw_input()\&. - -.SH "Author" -.PP -Generated automatically by Doxygen for Cmd2 from the source code'\&. |