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

Class Cmd

source code

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

Inherited from OriginalCmd: columnize, complete_help, completedefault, completenames, get_names, parseline, print_topics

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

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]
  next_possibility = {}
  history_header = ''
  _display_opts = ['options', 'variable']
  allow_notification_center = True
  debug_output = 'debug'
  error_debug = 'Please report this bug to developers\n\n ...
  config_debug = 'Please report this bug to developers\n\n ...
  keyboard_stop_msg = 'stopping all current operation\n ...
  plugin_path = ['/Users/omattelaer/Documents/workspace/madgraph...
  PluginCandidate = '/Users/omattelaer/Desktop/UFOMODEL'
  dirlist = ['DMsimp_s_spin0_LO_UFO_wgluons_allquarks_mixed', 'T...
  onedir = 'SM_HeavyN'

Inherited from OriginalCmd: 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: object.__init__

preloop(self)

source code 

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

Overrides: OriginalCmd.preloop

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: OriginalCmd.cmdloop
(inherited documentation)

precmd(self, line)

source code 

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

Overrides: OriginalCmd.precmd

postcmd(self, stop, line)

source code 

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

Overrides: OriginalCmd.postcmd

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.

onecmd(self, line, **opt)

source code 

catch all error and stop properly command accordingly

Overrides: OriginalCmd.onecmd

emptyline(self)

source code 

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

Overrides: OriginalCmd.emptyline

default(self, line, log=True)

source code 

Default action if line is not recognized

Overrides: OriginalCmd.default

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)

postloop(self)

source code 

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

Overrides: OriginalCmd.postloop

do_help(self, line)

source code 

Not in help: propose some usefull possible action

Overrides: OriginalCmd.do_help

Class Variable Details [hide private]

error_debug

Value:
'''Please report this bug to developers

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

           Please attach this file to your report.'''

config_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'''

plugin_path

Value:
['/Users/omattelaer/Documents/workspace/madgraph5/MG5_aMC_v2_6_5/PLUGI\
N']

dirlist

Value:
['DMsimp_s_spin0_LO_UFO_wgluons_allquarks_mixed',
 'TopEFT4F.tar.gz',
 '6pletProduction_UFO-1',
 'Top32_UFO',
 'EWdim6NLO_3',
 'restrict_quqd1.dat',
 'EFT_Zh',
 'EWHdim6NLO',
...