Package madgraph :: Package various :: Module misc
[hide private]
[frames] | no frames]

Module misc

source code

A set of functions performing routine administrative I/O tasks.

Classes [hide private]
  BackRead
read a file returning the lines in reverse order for each call of readline() This actually just reads blocks (4096 bytes by default) of data from the end of the file and returns last line in an internal buffer.
  open_file
a convinient class to open a file
Functions [hide private]
 
parse_info_str(fsock)
Parse a newline separated list of "param=value" as a dictionnary
source code
 
get_pkg_info(info_str=None)
Returns the current version information of the MadGraph package, as written in the VERSION text file.
source code
 
get_time_info()
Returns the present time info for use in MG5 command history header.
source code
 
which(program) source code
 
nice_representation(var, nb_space=0)
Return nice information on the current variable
source code
 
compile(arg=[], cwd=None, mode='fortran', **opt)
compile a given directory
source code
 
check_system_error(value=1) source code
 
call(arg, *args, **opt)
nice way to call an external program with nice error treatment
source code
 
Popen(arg, *args, **opt)
nice way to call an external program with nice error treatment
source code
 
tail(f, n, offset=None)
Reads a n lines from f with an offset of offset lines.
source code
 
get_last_line(fsock)
return the last line of a file
source code
 
is_executable(path)
check if a path is executable
source code
Variables [hide private]
  logger = logging.getLogger('cmdprint.ext_program')
  __package__ = 'madgraph.various'
Function Details [hide private]

get_pkg_info(info_str=None)

source code 

Returns the current version information of the MadGraph package, as written in the VERSION text file. If the file cannot be found, a dictionary with empty values is returned. As an option, an info string can be passed to be read instead of the file content.

call(arg, *args, **opt)

source code 

nice way to call an external program with nice error treatment

Decorators:
  • @check_system_error()

Popen(arg, *args, **opt)

source code 

nice way to call an external program with nice error treatment

Decorators:
  • @check_system_error()

tail(f, n, offset=None)

source code 

Reads a n lines from f with an offset of offset lines. The return value is a tuple in the form ``lines``.