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 a question with some pre-define possibility path info is
source code
 
check_answer_in_input_file(self, options, path=False)
Questions can have answer in output file (or not)
source code
 
check_stored_line(self) source code
 
clean_history(self, to_keep=['set', 'add', 'load'], remove_bef_lb1=None, to_remove=['open', 'display', 'launch'], keep_last=False)
Remove all commands in arguments from history
source code
 
correct_splitting(line)
if the line finish with a '-' the code splits in a weird way on GNU_SPLITTING
source code
 
default(self, line)
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)
exit the mainloop()
source code
 
do_display(self, line, output=sys.stdout)
Advanced commands: basic display
source code
 
do_exit(self, line)
exit the mainloop()
source code
 
do_help(self, line)
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_quit(self, line)
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
 
exec_cmd(self, line, errorhandling=False, printcmd=True, precmd=False, postcmd=True)
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
 
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
 
onecmd(self, line)
catch all error and stop properly command accordingly
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
 
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)
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, preloop, print_suggestions

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

Static Methods [hide private]
 
list_completion(text, list, line='')
Propose completions of text in list
source code
 
path_completion(text, base_dir=None, only_dirs=False, relative=True)
Propose completions of text to compose a valid path
source code
 
split_arg(line)
Split a line of arguments
source code
 
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
Class Variables [hide private]
  _display_opts = ['options', 'variable']
  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__

default(self, line)

source code 

Default action if line is not recognized

Overrides: cmd.Cmd.default

do_help(self, line)

source code 

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)

source code 

catch all error and stop properly command accordingly

Overrides: cmd.Cmd.onecmd

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

Class Variable Details [hide private]

config_debug

Value:
'''Please report this bug to developers

           More information is found in \'%s\'.

           Please attach this file to your report.'''

error_debug

Value:
'''Please report this bug to developers

           More information is found in \'%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'''