Package madgraph :: Package interface :: Module master_interface
[hide private]
[frames] | no frames]

Source Code for Module madgraph.interface.master_interface

  1  ################################################################################ 
  2  # 
  3  # Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors 
  4  # 
  5  # This file is a part of the MadGraph5_aMC@NLO project, an application which  
  6  # automatically generates Feynman diagrams and matrix elements for arbitrary 
  7  # high-energy processes in the Standard Model and beyond. 
  8  # 
  9  # It is subject to the MadGraph5_aMC@NLO license which should accompany this  
 10  # distribution. 
 11  # 
 12  # For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch 
 13  # 
 14  ################################################################################ 
 15  """A user friendly command line interface to access all MadGraph5_aMC@NLO features. 
 16     Uses the cmd package for command interpretation and tab completion. 
 17  """ 
 18   
 19   
 20  import atexit 
 21  import logging 
 22  import optparse 
 23  import os 
 24  import pydoc 
 25  import re 
 26  import subprocess 
 27  import sys 
 28  import traceback 
 29  import time 
 30   
 31  root_path = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0] 
 32  root_path = os.path.split(root_path)[0] 
 33  sys.path.insert(0, root_path) 
 34   
 35  #usefull shortcut 
 36  pjoin = os.path.join 
 37   
 38  import madgraph 
 39  import madgraph.core.diagram_generation as diagram_generation 
 40  import madgraph.core.helas_objects as helas_objects 
 41  import madgraph.loop.loop_base_objects as loop_base_objects 
 42  import madgraph.interface.extended_cmd as cmd 
 43  import madgraph.interface.madgraph_interface as MGcmd 
 44  import madgraph.interface.loop_interface as LoopCmd 
 45  import madgraph.interface.amcatnlo_interface as amcatnloCmd 
 46  import madgraph.fks.fks_base as fks_base 
 47  import madgraph.iolibs.files as files 
 48  import madgraph.various.misc as misc 
 49   
 50  from madgraph import MG4DIR, MG5DIR, MadGraph5Error 
 51   
 52  logger = logging.getLogger('cmdprint') # -> stdout 
53 54 55 -class Switcher(object):
56 """ Helping class containing all the switching routine """ 57
58 - def __init__(self, main='MadGraph', *args, **opt):
59 60 # define the interface 61 self.change_principal_cmd(main) 62 self.cmd.__init__(self, *args, **opt)
63 64 interface_names= {'MadGraph':('MG5_aMC',MGcmd.MadGraphCmd), 65 'MadLoop':('MG5_aMC',LoopCmd.LoopInterface), 66 'aMC@NLO':('MG5_aMC',amcatnloCmd.aMCatNLOInterface)} 67 68 _switch_opts = interface_names.keys() 69 current_interface = None 70 71 # Helper functions 72
73 - def setup(self, *args, **opts):
74 """ Function to initialize the interface when switched to it. It is not 75 the same as __init__ as this latter functions would call its mother 76 from madgraph_interface and this is only desirable for the first 77 initialization when launching MG5 """ 78 return self.cmd.setup(self, *args, **opts)
79 157 158 159 160 @staticmethod
161 - def extract_process_type(line):
162 """Extract from a string what is the type of the computation. This 163 returns a tuple (mode, option, pert_orders) where mode can be either 'NLO' or 'tree' 164 and option 'all', 'real' or 'virt'.""" 165 166 # Perform sanity modifications on the lines: 167 # Add a space before and after any > , $ / | [ ] 168 space_before = re.compile(r"(?P<carac>\S)(?P<tag>[\\[\\]/\,\\$\\>|])(?P<carac2>\S)") 169 line2 = space_before.sub(r'\g<carac> \g<tag> \g<carac2>', line) 170 171 # Use regular expressions to extract the loop mode (if present) and its 172 # option, specified in the line with format [ option = loop_orders ] or 173 # [ loop_orders ] which implicitly select the 'all' option. 174 loopRE = re.compile(r"^(.*)(?P<loop>\[(\s*(?P<option>\w+)\s*=)?(?P<orders>.+)?\])(.*)$") 175 # Make sure that the content of options following '--' are not considered. 176 res=loopRE.search(line.split('--')[0]) 177 if res: 178 orders=res.group('orders').split() if res.group('orders') else [] 179 if res.group('option') and len(res.group('option').split())==1: 180 if res.group('option').split()[0]=='tree': 181 return ('tree',res.group('option').split()[0],orders) 182 else: 183 return ('NLO',res.group('option').split()[0],orders) 184 else: 185 # If not option is set the convention is that the mode is 'all' 186 # unless no perturbation orders is defined. 187 # if order is set to LOonly assume LOonly=QCD 188 if orders == ['LOonly']: 189 return ('NLO', 'LOonly', ['QCD']) 190 elif len(orders)>0: 191 return ('NLO','all',orders) 192 else: 193 return ('tree',None,[]) 194 else: 195 return ('tree',None,[])
196 197 # Wrapping functions possibly switching to new interfaces 198
199 - def do_add(self, line, *args, **opts):
200 201 argss = cmd.Cmd.split_arg(line) 202 if len(argss)>=1 and argss[0] in ['process','timing','profile']: 203 proc_line = ' '.join(argss[1:]) 204 (type,nlo_mode,orders)=self.extract_process_type(proc_line) 205 if type=='NLO': 206 if not nlo_mode in self._valid_nlo_modes: raise self.InvalidCMD( \ 207 'The NLO mode %s is not valid. Please choose one among: %s' \ 208 % (nlo_mode, ' '.join(self._valid_nlo_modes))) 209 elif nlo_mode in ['all', 'real', 'LOonly']: 210 self.change_principal_cmd('aMC@NLO') 211 elif nlo_mode in ['virt', 'sqrvirt']: 212 self.change_principal_cmd('MadLoop') 213 elif nlo_mode == 'noborn': 214 self.change_principal_cmd('MadLoop') 215 self.cmd.validate_model(self, loop_type=nlo_mode, 216 coupling_type=orders) 217 self.change_principal_cmd('MadGraph') 218 return self.cmd.create_loop_induced(self, line, *args, **opts) 219 try: 220 return self.cmd.do_add(self, line, *args, **opts) 221 except fks_base.NoBornException: 222 logger.info("------------------------------------------------------------------------", '$MG:color:BLACK') 223 logger.info(" No Born diagrams found. Now switching to the loop-induced mode. ", '$MG:color:BLACK') 224 logger.info(" Please cite ref. 'arXiv:1507.00020' when using results from this mode. ", '$MG:color:BLACK') 225 logger.info("------------------------------------------------------------------------", '$MG:color:BLACK') 226 self.change_principal_cmd('MadGraph') 227 return self.cmd.create_loop_induced(self, line, *args, **opts)
228 229
230 - def do_check(self, line, *args, **opts):
231 232 argss = self.split_arg(line) 233 proc_line = " ".join(argss[1:]) 234 (type,nlo_mode,orders)=self.extract_process_type(proc_line) 235 if type=='NLO': 236 if not nlo_mode in self._valid_nlo_modes: raise self.InvalidCMD(\ 237 'The NLO mode %s is not valid. Please chose one among: %s' \ 238 % (nlo_mode, ' '.join(self._valid_nlo_modes))) 239 elif nlo_mode == 'all': 240 self.change_principal_cmd('MadLoop') 241 elif nlo_mode == 'real': 242 raise self.InvalidCMD('Mode [real=...] not valid for checking processes.') 243 self.change_principal_cmd('aMC@NLO') 244 elif nlo_mode == 'virt' or nlo_mode == 'sqrvirt': 245 self.change_principal_cmd('MadLoop') 246 else: 247 self.change_principal_cmd('MadGraph') 248 249 return self.cmd.do_check(self, line, *args, **opts)
250
251 - def do_generate(self, line, *args, **opts):
252 253 argss = cmd.Cmd.split_arg(line) 254 # Make sure to switch to the right interface. 255 if len(argss)>=1: 256 proc_line = ' '.join(argss[1:]) 257 (type,nlo_mode,orders)=self.extract_process_type(proc_line) 258 if type=='NLO': 259 if not nlo_mode in self._valid_nlo_modes: raise self.InvalidCmd( \ 260 'The NLO mode %s is not valid. Please chose one among: %s' \ 261 % (nlo_mode, ' '.join(self._valid_nlo_modes))) 262 elif nlo_mode in ['all', 'real', 'LOonly']: 263 self._fks_multi_proc = fks_base.FKSMultiProcess() 264 self.change_principal_cmd('aMC@NLO') 265 elif nlo_mode == 'virt' or nlo_mode == 'virtsqr': 266 self.change_principal_cmd('MadLoop') 267 else: 268 self.change_principal_cmd('MadGraph') 269 return self.cmd.do_generate(self, line, *args, **opts)
270
271 - def do_import(self, *args, **opts):
272 self.cmd.do_import(self, *args, **opts) 273 if self._curr_model: 274 if isinstance(self._curr_model, loop_base_objects.LoopModel) and \ 275 self._curr_model['perturbation_couplings']!=[] and \ 276 self.current_interface not in ['aMC@NLO','MadLoop']: 277 self.change_principal_cmd('aMC@NLO') 278 if (not isinstance(self._curr_model, loop_base_objects.LoopModel) or \ 279 self._curr_model['perturbation_couplings']==[]) and \ 280 self.current_interface in ['MadLoop']: 281 self.change_principal_cmd('MadGraph') 282 import madgraph.various.misc as misc 283 return
284
285 - def do_output(self, line, *args, **opts):
286 """ treat output aloha in order to use always the one in MG5 """ 287 if line.strip().startswith('aloha'): 288 MGcmd.MadGraphCmd.do_output(self, line, *args, **opts) 289 else: 290 self.cmd.do_output(self, line, *args, **opts)
291
292 - def check_output(self, arg, *args, **opts):
293 if arg and arg[0] == 'aloha': 294 MGcmd.MadGraphCmd.check_output(self, arg, *args, **opts) 295 else: 296 self.cmd.check_output(self, arg, *args, **opts)
297 298 299 300 301 # Dummy functions, not triggering any switch of interfaces 302
303 - def export(self, *args, **opts):
304 return self.cmd.export(self, *args, **opts)
305
306 - def check_add(self, *args, **opts):
307 return self.cmd.check_add(self, *args, **opts)
308
309 - def check_answer_in_input_file(self, *args, **opts):
310 return self.cmd.check_answer_in_input_file(self, *args, **opts)
311
312 - def check_check(self, *args, **opts):
313 return self.cmd.check_check(self, *args, **opts)
314
315 - def check_define(self, *args, **opts):
316 return self.cmd.check_define(self, *args, **opts)
317
318 - def check_decay_diagram(self, *args, **opts):
319 return self.cmd.check_decay_diagram(self, *args, **opts)
320
321 - def complete_decay_diagram(self, *args, **opts):
322 return self.cmd.complete_decay_diagram(self, *args, **opts)
323
324 - def do_decay_diagram(self, *args, **opts):
325 return self.cmd.do_decay_diagram(self, *args, **opts)
326
327 - def help_decay_diagram(self, *args, **opts):
328 return self.cmd.help_decay_diagram(self, *args, **opts)
329
330 - def check_compute_widths(self, *args, **opts):
331 return self.cmd.check_compute_widths(self, *args, **opts)
332
333 - def complete_compute_widths(self, *args, **opts):
334 return self.cmd.complete_compute_widths(self, *args, **opts)
335
336 - def do_compute_widths(self, *args, **opts):
337 return self.cmd.do_compute_widths(self, *args, **opts)
338
339 - def help_compute_widths(self, *args, **opts):
340 return self.cmd.help_compute_widths(self, *args, **opts)
341
342 - def check_display(self, *args, **opts):
343 return self.cmd.check_display(self, *args, **opts)
344
345 - def check_draw(self, *args, **opts):
346 return self.cmd.check_draw(self, *args, **opts)
347
348 - def check_for_export_dir(self, *args, **opts):
349 return self.cmd.check_for_export_dir(self, *args, **opts)
350
351 - def check_generate(self, *args, **opts):
352 return self.cmd.check_generate(self, *args, **opts)
353
354 - def check_tutorial(self, *args, **opts):
355 return self.cmd.check_tutorial(self, *args, **opts)
356
357 - def check_history(self, *args, **opts):
358 return self.cmd.check_history(self, *args, **opts)
359
360 - def check_import(self, *args, **opts):
361 return self.cmd.check_import(self, *args, **opts)
362
363 - def check_install(self, *args, **opts):
364 return self.cmd.check_install(self, *args, **opts)
365
366 - def check_launch(self, *args, **opts):
367 return self.cmd.check_launch(self, *args, **opts)
368
369 - def check_load(self, *args, **opts):
370 return self.cmd.check_load(self, *args, **opts)
371
372 - def check_open(self, *args, **opts):
373 return self.cmd.check_open(self, *args, **opts)
374
375 - def check_process_format(self, *args, **opts):
376 return self.cmd.check_process_format(self, *args, **opts)
377
378 - def check_save(self, *args, **opts):
379 return self.cmd.check_save(self, *args, **opts)
380
381 - def check_set(self, *args, **opts):
382 return self.cmd.check_set(self, *args, **opts)
383
384 - def get_stored_line(self, *args, **opts):
385 return self.cmd.get_stored_line(self, *args, **opts)
386
387 - def complete_add(self, *args, **opts):
388 return self.cmd.complete_add(self, *args, **opts)
389
390 - def complete_switch(self, *args, **opts):
391 return self.cmd.complete_switch(self, *args, **opts)
392
393 - def complete_check(self, *args, **opts):
394 return self.cmd.complete_check(self, *args, **opts)
395
396 - def complete_define(self, *args, **opts):
397 return self.cmd.complete_define(self, *args, **opts)
398
399 - def complete_display(self, *args, **opts):
400 return self.cmd.complete_display(self, *args, **opts)
401
402 - def complete_draw(self, *args, **opts):
403 return self.cmd.complete_draw(self, *args, **opts)
404
405 - def complete_generate(self, *args, **opts):
406 return self.cmd.complete_generate(self, *args, **opts)
407
408 - def complete_help(self, *args, **opts):
409 return self.cmd.complete_help(self, *args, **opts)
410
411 - def complete_history(self, *args, **opts):
412 return self.cmd.complete_history(self, *args, **opts)
413
414 - def complete_import(self, *args, **opts):
415 return self.cmd.complete_import(self, *args, **opts)
416
417 - def complete_install(self, *args, **opts):
418 return self.cmd.complete_install(self, *args, **opts)
419
420 - def complete_launch(self, *args, **opts):
421 return self.cmd.complete_launch(self, *args, **opts)
422
423 - def complete_load(self, *args, **opts):
424 return self.cmd.complete_load(self, *args, **opts)
425
426 - def complete_open(self, *args, **opts):
427 return self.cmd.complete_open(self, *args, **opts)
428
429 - def complete_output(self, *args, **opts):
430 return self.cmd.complete_output(self, *args, **opts)
431
432 - def complete_save(self, *args, **opts):
433 return self.cmd.complete_save(self, *args, **opts)
434
435 - def complete_set(self, *args, **opts):
436 return self.cmd.complete_set(self, *args, **opts)
437
438 - def complete_tutorial(self, *args, **opts):
439 return self.cmd.complete_tutorial(self, *args, **opts)
440
441 - def do_switch(self, *args, **opts):
442 """Not in help """ 443 return self.cmd.do_switch(self, *args, **opts)
444
445 - def do_EOF(self, *args, **opts):
446 return self.cmd.do_EOF(self, *args, **opts)
447
448 - def do_define(self, *args, **opts):
449 return self.cmd.do_define(self, *args, **opts)
450
451 - def do_display(self, *args, **opts):
452 return self.cmd.do_display(self, *args, **opts)
453
454 - def do_exit(self, *args, **opts):
455 return self.cmd.do_exit(self, *args, **opts)
456
457 - def do_help(self, *args, **opts):
458 return self.cmd.do_help(self, *args, **opts)
459
460 - def do_history(self, *args, **opts):
461 return self.cmd.do_history(self, *args, **opts)
462
463 - def do_install(self, *args, **opts):
464 self.cmd.do_install(self, *args, **opts)
465
466 - def do_launch(self, line, *argss, **opts):
467 args = cmd.Cmd.split_arg(line) 468 # check if a path is given 469 if len(args) >=1: 470 if os.path.isdir(args[0]): 471 path = os.path.realpath(args[0]) 472 elif os.path.isdir(pjoin(MG5DIR,args[0])): 473 path = pjoin(MG5DIR,args[0]) 474 elif MG4DIR and os.path.isdir(pjoin(MG4DIR,args[0])): 475 path = pjoin(MG4DIR,args[0]) 476 else: 477 path=None 478 # if there is a path, find what output has been done 479 if path: 480 type = self.cmd.find_output_type(self, path) 481 if type in ['standalone', 'standalone_cpp', 'pythia8', 'madevent']: 482 self.change_principal_cmd('MadGraph') 483 elif type == 'aMC@NLO': 484 self.change_principal_cmd('aMC@NLO') 485 elif type == 'MadLoop': 486 self.change_principal_cmd('MadLoop') 487 488 return self.cmd.do_launch(self, line, *argss, **opts)
489
490 - def do_load(self, *args, **opts):
491 return self.cmd.do_load(self, *args, **opts)
492
493 - def do_open(self, *args, **opts):
494 return self.cmd.do_open(self, *args, **opts)
495
496 - def do_quit(self, *args, **opts):
497 return self.cmd.do_quit(self, *args, **opts)
498
499 - def do_save(self, *args, **opts):
500 return self.cmd.do_save(self, *args, **opts)
501
502 - def do_set(self, *args, **opts):
503 return self.cmd.do_set(self, *args, **opts)
504
505 - def do_tutorial(self, *args, **opts):
506 return self.cmd.do_tutorial(self, *args, **opts)
507
508 - def help_EOF(self, *args, **opts):
509 return self.cmd.help_EOF(self, *args, **opts)
510
511 - def help_add(self, *args, **opts):
512 return self.cmd.help_add(self, *args, **opts)
513
514 - def help_check(self, *args, **opts):
515 return self.cmd.help_check(self, *args, **opts)
516
517 - def help_define(self, *args, **opts):
518 return self.cmd.help_define(self, *args, **opts)
519
520 - def help_display(self, *args, **opts):
521 return self.cmd.help_display(self, *args, **opts)
522
523 - def help_generate(self, *args, **opts):
524 return self.cmd.help_generate(self, *args, **opts)
525
526 - def help_help(self, *args, **opts):
527 return self.cmd.help_help(self, *args, **opts)
528
529 - def help_history(self, *args, **opts):
530 return self.cmd.help_history(self, *args, **opts)
531
532 - def help_import(self, *args, **opts):
533 return self.cmd.help_import(self, *args, **opts)
534
535 - def help_install(self, *args, **opts):
536 return self.cmd.help_install(self, *args, **opts)
537
538 - def help_launch(self, *args, **opts):
539 return self.cmd.help_launch(self, *args, **opts)
540
541 - def help_load(self, *args, **opts):
542 return self.cmd.help_load(self, *args, **opts)
543
544 - def help_open(self, *args, **opts):
545 return self.cmd.help_open(self, *args, **opts)
546
547 - def help_output(self, *args, **opts):
548 return self.cmd.help_output(self, *args, **opts)
549
550 - def help_quit(self, *args, **opts):
551 return self.cmd.help_quit(self, *args, **opts)
552
553 - def help_save(self, *args, **opts):
554 return self.cmd.help_save(self, *args, **opts)
555
556 - def help_set(self, *args, **opts):
557 return self.cmd.help_set(self, *args, **opts)
558
559 - def help_tutorial(self, *args, **opts):
560 return self.cmd.help_tutorial(self, *args, **opts)
561
562 - def test_interface(self, *args, **opts):
563 return self.cmd.test_interface(self, *args, **opts)
564
565 - def set_configuration(self, *args, **opts):
566 return self.cmd.set_configuration(self, *args, **opts)
567
568 - def check_customize_model(self, *args, **opts):
569 return self.cmd.check_customize_model(self, *args, **opts)
570
571 - def complete_customize_model(self, *args, **opts):
572 return self.cmd.complete_customize_model(self, *args, **opts)
573
574 - def do_customize_model(self, *args, **opts):
575 return self.cmd.do_customize_model(self, *args, **opts)
576
577 - def help_customize_model(self, *args, **opts):
578 return self.cmd.help_customize_model(self, *args, **opts)
579
580 -class MasterCmd(Switcher, LoopCmd.LoopInterface, amcatnloCmd.aMCatNLOInterface, cmd.CmdShell):
581
582 - def __init__(self, main='MadGraph', *args, **opt):
583 584 # define the interface 585 if main in self.interface_names.keys(): 586 self.prompt= self.interface_names[main][0]+'>' 587 self.cmd= self.interface_names[main][1] 588 self.current_interface=main 589 else: 590 raise MadGraph5Error, 'Type of interface not valid: %s' % main 591 self.cmd.__init__(self, *args, **opt) 592 self.current_interface = main
593
594 - def complete_switch(self, text, line, begidx, endidx):
595 """Complete the switch command""" 596 return self.list_completion(text,self._switch_opts)
597
598 - def do_switch(self, line):
599 """Not in help: Allow to switch to any given interface from command line """ 600 601 args = cmd.Cmd.split_arg(line) 602 if len(args)==1 and args[0] in self.interface_names.keys(): 603 self.change_principal_cmd(args[0]) 604 else: 605 raise self.InvalidCmd("Invalid switch command or non existing interface %s."\ 606 %args[0]+" Valid interfaces are %s"\ 607 %','.join(interface_quick_name.keys()))
608
609 - def change_principal_cmd(self, name):
610 old_cmd=self.current_interface 611 if name in self.interface_names.keys(): 612 self.prompt= self.interface_names[name][0]+'>' 613 self.cmd= self.interface_names[name][1] 614 self.current_interface=name 615 else: 616 raise MadGraph5Error, 'Type of interface not valid: %s' % name 617 618 if self.interface_names[old_cmd][0]!=self.interface_names[name][0]: 619 logger.info("Switching from interface %s to %s"\ 620 %(self.interface_names[old_cmd][0],\ 621 self.interface_names[name][0])) 622 # Setup the interface 623 self.cmd.setup(self) 624 625 if __debug__: 626 self.debug_link_to_command()
627
628 629 -class MasterCmdWeb(MGcmd.MadGraphCmdWeb, Switcher, LoopCmd.LoopInterfaceWeb):
630
631 - def __init__(self, *arg, **opt):
632 633 if os.environ.has_key('_CONDOR_SCRATCH_DIR'): 634 self.writing_dir = pjoin(os.environ['_CONDOR_SCRATCH_DIR'], \ 635 os.path.pardir) 636 else: 637 self.writing_dir = pjoin(os.environ['MADGRAPH_DATA'], 638 os.environ['REMOTE_USER']) 639 640 641 #standard initialization 642 Switcher.__init__(self, mgme_dir = '', *arg, **opt) 643 644 self.options['timeout'] = 1 # time authorize to answer question [0 is no time limit]
645
646 - def change_principal_cmd(self, name):
647 if name == 'MadGraph': 648 self.cmd = MGcmd.MadGraphCmdWeb 649 elif name == 'Loop': 650 self.cmd = LoopCmd.LoopInterfaceWeb 651 else: 652 raise MadGraph5Error, 'Type of interface not valid' 653 654 if __debug__: 655 self.debug_link_to_command()
656
657 - def do_shell(self, *args):
658 raise Exception
659
660 - def finalize(self, nojpeg, flaglist=[]):
661 """Finalize web generation""" 662 663 if flaglist != []: 664 raise Exception 665 self.cmd.finalize(self, nojpeg, online = True)
666
667 - def finalize(self, nojpeg, **opts):
668 """Finalize web generation""" 669 670 opts['online'] = True 671 self.cmd.finalize(self, nojpeg, opts)
672 673 # Generate a new amplitude
674 - def do_generate(self, line):
675 """Generate an amplitude for a given process""" 676 677 try: 678 Switcher.do_generate(self, line) 679 except: 680 # put the stop logo on the web 681 files.cp(self._export_dir+'/HTML/stop.jpg',self._export_dir+'/HTML/card.jpg') 682 raise
683 684 # Add a process to the existing multiprocess definition
685 - def do_add(self, line):
686 """Generate an amplitude for a given process and add to 687 existing amplitudes 688 syntax: 689 """ 690 try: 691 Switcher.do_add(self, line) 692 except: 693 # put the stop logo on the web 694 files.cp(self._export_dir+'/HTML/stop.jpg',self._export_dir+'/HTML/card.jpg') 695 raise
696 697 # Use the cluster file for the configuration
698 - def set_configuration(self, config_path=None, final=False):
699 700 """Force to use the web configuration file only""" 701 config_path = pjoin(os.environ['MADGRAPH_BASE'], 'mg5_configuration.txt') 702 return Switcher.set_configuration(self, config_path=config_path, final=final)
703
704 - def do_save(self, line, check=True, **opt):
705 """Save information to file""" 706 707 if check: 708 self.check_save([]) 709 raise #useless but full security 710 711 args = self.split_arg(line) 712 if args[0] != 'options': 713 Switcher.do_save(self, line,check, opt) 714 else: 715 # put default options since 716 # in the web the local file is not used 717 # in download the default file is more usefull 718 files.cp(pjoin(MG5DIR,'input','mg5_configuration.txt'), args[1])
719
720 - def do_install(self, line):
721 """block all install""" 722 return
723