Package madgraph :: Package interface :: Module extended_cmd :: Class Cmd
[hide private]
[frames] | no frames]

Class Cmd

source code

 object --+    
          |    
   CheckCmd --+
              |
 object --+   |
          |   |
    HelpCmd --+
              |
 object --+   |
          |   |
CompleteCmd --+
              |
cmd.Cmd --+   |
          |   |
   BasicCmd --+
              |
             Cmd
Known Subclasses:

Extension of the cmd.Cmd command line. This extensions supports line breaking, history, comments, internal call to cmdline, path completion,... this class should be MG5 independent

Nested Classes [hide private]
  ConfigurationError
expected error for wrong command
  InvalidCmd
expected error for wrong command
Instance Methods [hide private]
 
__init__(self, *arg, **opt)
Init history and line continuation
source code
 
ask(self, question, default, choices=[], path_msg=None, timeout=True, fct_timeout=None, ask_class=None, alias={}, first_cmd=None, text_format='4', **opt)
ask a question with some pre-define possibility path info is
source code
 
avoid_history_duplicate(self, line, no_break=[])
remove all line in history (but the last) starting with line.
source code
 
check_answer_in_input_file(self, question_instance, default, path=False)
Questions can have answer in output file (or not)
source code
 
check_import(self, args)
check import command
source code
 
cmdloop(self, intro=None)
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.
source code
 
compile(self, *args, **opts) source code
 
default(self, line, log=True)
Default action if line is not recognized
source code
 
define_child_cmd_interface(self, obj_instance, interface=True)
Define a sub cmd_interface
source code
 
do_EOF(self, line)
Not in help: exit the mainloop()
source code
 
do_display(self, line, output=sys.stderr)
Advanced commands: basic display
source code
 
do_exit(self, line)
Not in help: exit the mainloop()
source code
 
do_help(self, line)
Not in help: propose some usefull possible action
source code
 
do_history(self, line)
write in a file the suite of command that was used
source code
 
do_import(self, line)
Advanced commands: Import command files
source code
 
do_quit(self, line)
Not in help: exit the mainloop()
source code
 
do_save(self, line, check=True)
Save the configuration file
source code
 
emptyline(self)
If empty line, do nothing.
source code
 
error_handling(self, error, line) source code
 
exec_cmd(self, line, errorhandling=False, printcmd=True, precmd=False, postcmd=True, **opt)
for third party call, call the line with pre and postfix treatment without global error handling
source code
 
get_history_header(self)
Default history header
source code
 
get_stored_line(self)
return stored line and clean it
source code
 
import_command_file(self, filepath) source code
 
nice_config_error(self, error, line) source code
 
nice_error_handling(self, error, line) source code
 
nice_user_error(self, error, line) source code
 
no_notification(self)
avoid to have html opening / notification
source code
 
onecmd(self, line, **opt)
catch all error and stop properly command accordingly
source code
 
onecmd_orig(self, line, **opt)
Interpret the argument as though it had been typed in response to the prompt.
source code
 
postcmd(self, stop, line)
finishing a command This looks if the command add a special post part.
source code
 
postloop(self)
Hook method executed once when the cmdloop() method is about to return.
source code
 
precmd(self, line)
A suite of additional function needed for in the cmd this implement history, line breaking, comment treatment,...
source code
 
preloop(self)
Hook method executed once when the cmdloop() method is called.
source code
 
run_cmd(self, line)
for third party call, call the line with pre and postfix treatment with global error handling
source code
 
stop_on_keyboard_stop(self)
action to perform to close nicely on a keyboard interupt
source code
 
store_line(self, line)
store a line of the input file which should be executed by the higher mother
source code
 
write_configuration(self, filepath, basefile, basedir, to_keep)
Write the configuration file
source code

Inherited from CheckCmd: check_history, check_save

Inherited from HelpCmd: help_EOF, help_display, help_help, help_history, help_quit, help_save

Inherited from CompleteCmd: complete_display, complete_history, complete_save

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from BasicCmd: complete, deal_multiple_categories, getTerminalSize, print_suggestions

Inherited from cmd.Cmd: columnize, complete_help, completedefault, completenames, get_names, parseline, print_topics

Static Methods [hide private]
 
timed_input(question, default, timeout=None, noerror=True, fct=None, fct_timeout=None)
a question with a maximal time to answer take default otherwise
source code

Inherited from BasicCmd: list_completion, path_completion, split_arg

Class Variables [hide private]
  _display_opts = ['options', 'variable']
  allow_notification_center = True
  config_debug = 'Please report this bug to developers\n\n ...
  debug_output = 'debug'
  error_debug = 'Please report this bug to developers\n\n ...
  history_header = ''
  keyboard_stop_msg = 'stopping all current operation\n ...
  next_possibility = {}

Inherited from cmd.Cmd: doc_header, doc_leader, identchars, intro, lastcmd, misc_header, nohelp, prompt, ruler, undoc_header, use_rawinput

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *arg, **opt)
(Constructor)

source code 

Init history and line continuation

Overrides: cmd.Cmd.__init__

avoid_history_duplicate(self, line, no_break=[])

source code 

remove all line in history (but the last) starting with line. up to the point when a line didn't start by something in no_break. (reading in reverse order)

cmdloop(self, intro=None)

source code 

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.

Overrides: cmd.Cmd.cmdloop
(inherited documentation)

default(self, line, log=True)

source code 

Default action if line is not recognized

Overrides: cmd.Cmd.default

do_help(self, line)

source code 

Not in help: propose some usefull possible action

Overrides: cmd.Cmd.do_help

emptyline(self)

source code 

If empty line, do nothing. Default is repeat previous command.

Overrides: cmd.Cmd.emptyline

onecmd(self, line, **opt)

source code 

catch all error and stop properly command accordingly

Overrides: cmd.Cmd.onecmd

onecmd_orig(self, line, **opt)

source code 

Interpret the argument as though it had been typed in response to the prompt.

The return value is a flag indicating whether interpretation of commands by the interpreter should stop.

This allow to pass extra argument for internal call.

postcmd(self, stop, line)

source code 

finishing a command This looks if the command add a special post part.

Overrides: cmd.Cmd.postcmd

postloop(self)

source code 

Hook method executed once when the cmdloop() method is about to return.

Overrides: cmd.Cmd.postloop

precmd(self, line)

source code 

A suite of additional function needed for in the cmd this implement history, line breaking, comment treatment,...

Overrides: cmd.Cmd.precmd

preloop(self)

source code 

Hook method executed once when the cmdloop() method is called.

Overrides: cmd.Cmd.preloop

Class Variable Details [hide private]

config_debug

Value:
'''Please report this bug to developers

           More information is found in \'%(debug)s\'.

           Please attach this file to your report.'''

error_debug

Value:
'''Please report this bug to developers

           More information is found in \'%(debug)s\'.

           Please attach this file to your report.'''

keyboard_stop_msg

Value:
'''stopping all current operation
            in order to quit the program please enter exit'''