rvt2 module¶
The entry point to the system.
-
class
rvt2.
StoreDict
(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)¶ Bases:
argparse.Action
An argparse.Action to parse additional parameters as a dictionary.
Parameters have the syntax name=value. Only the first _=_ is relevant. If the value part is not provided, assign the string ‘True’ to the name.
Example::
>>> import argparse >>> parser = argparse.ArgumentParser(prog='PROG') >>> _= parser.add_argument('-p', '--params', action=StoreDict, nargs='*', default={}) >>> parser.parse_args(['-p', 'one=one_value', '-p', 'two', '--params', 'three=three_value1=three_value2', 'four=four_value']) Namespace(params={'one': 'one_value', 'two': 'True', 'three': 'three_value1=three_value2', 'four': 'four_value'})
-
rvt2.
configure_logging
(config, verbose=False, jobname=None)¶ Configure the logging subsystem.
- Attrs:
verbose (boolean): If true, set the logging to verbose regardless what the configuration says. jobname (String): The name of the job to be run. If None, use basic configuration. If the job defines in its section register: False, use basic configuration.
-
rvt2.
load_configpaths
(config, configpaths)¶ Load configuration from an array of paths.
- Attrs:
- configpaths
Array of paths to load configuration from. Unexisting paths are ignored
-
rvt2.
load_default_vars
(config, morgue, casename, source, jobid)¶ Add to the configuration object the default variables: morgue, casename, source and jobid
-
rvt2.
load_plugin
(pluginpath, config)¶ Load a plugin from a path.
Load all cfg files inside the path. if configuration section ‘pluginame.pythonpath exists, load the python path in this section If funcion plugin.load_plugin() exists, run it.
- Attrs:
- pluginpath
The absolute path to the plugin
- config
The configuration object
-
rvt2.
main
(params=['-b', 'html', 'source', 'build'])¶ The entry point of the system. Run from the command line and get help using –help.
Read configuration files and run jobs.
- Attrs:
- params
The parameters to configure the system
-
rvt2.
registerExecution
(jobid, config, conffiles, job, params, paths, status, ellapsed=0.0)¶ Register the execution of the rvt2 in a file with a timestamp.
- Attrs:
- config
The configuration object. morgue, casename and source will be get from the DEFAULT section. The filename is in “rvt2:register”. If filename is empty, do not register. If “jobname:register” is False, do not register
- conffiles
List of extra configuration files
- job
The name of the job
- params
Any extra params
- paths
The list of paths
- status
either ‘start’, ‘end’, ‘interrupted’ or ‘error’
- ellapsed (float)
elapsed time (in hours)