HWRF
trunk@4391
|
This module runs the NCO dbn_alert program, or logs dbn_alert messages if run with dbn alerts disabled. More...
This module runs the NCO dbn_alert program, or logs dbn_alert messages if run with dbn alerts disabled.
Classes | |
class | DBNAlert |
This class represents a call to dbn_alert, as a callable Python object. More... | |
Functions | |
def | find_dbn_alert () |
Locates the dbn_alert executable based on environment variables, and returns it as a produtil.prog.Runner object. More... | |
def | init_logging |
Initializes logging for this module. More... | |
def | init_jobstring |
Sets the job string (for dbn_alerts) to the specified value, or if unspecified, tries to guess one from the environment. More... | |
def | init_dbn_alert |
DBN alert initialization helper function. More... | |
def | init_module |
Call to initialize this module. More... | |
Variables | |
list | __all__ = ["DBNAlert"] |
Symbols exported by "from produtil.dbnalert import *". | |
log = None | |
logging.Logger object to send dbnalert messages | |
job = None | |
a string representing this job (from os.environ['job'] by default) | |
send_dbn_alerts = True | |
False = don't run dbn_alert. More... | |
no_DBNROOT_warn = False | |
True = I have already warned that $DBNROOT is unset. | |
def produtil.dbnalert.find_dbn_alert | ( | ) |
Locates the dbn_alert executable based on environment variables, and returns it as a produtil.prog.Runner object.
Definition at line 32 of file dbnalert.py.
|
protected |
DBN alert initialization helper function.
This is part of the implementation of init_module: it decides whether to send DBNet alerts, and sets the module-scope send_dbn_alerts variable accordingly. That will then be used by DBNAlert objects to decide whether to actually call the dbn_alert program.
send_dbn | Do we send dbn alerts? |
Definition at line 146 of file dbnalert.py.
Referenced by produtil.dbnalert.init_module().
def produtil.dbnalert.init_jobstring | ( | jobname = None | ) |
Sets the job string (for dbn_alerts) to the specified value, or if unspecified, tries to guess one from the environment.
Definition at line 113 of file dbnalert.py.
Referenced by produtil.dbnalert.init_module().
def produtil.dbnalert.init_logging | ( | logger = None | ) |
Initializes logging for this module.
The argument is either a logging.Logger to log to, or the string name of the logging domain.
Definition at line 101 of file dbnalert.py.
Referenced by produtil.dbnalert.init_module().
def produtil.dbnalert.init_module | ( | logger = None , |
|
jobname = None , |
|||
send_dbn = None |
|||
) |
Call to initialize this module.
Initializes the logging and job string for this module.
logger | Either a logging.Logger object to receive log messages, or the string name of a logger domain. |
jobname | The dbn_alert job string for this job. |
send_dbn | Optional. If specified, this controls whether dbn_alert is actually run (True) or not (False). If unspecified, then the SENDDBN environment variable is used. |
Definition at line 193 of file dbnalert.py.
Referenced by produtil.setup.setup().
produtil.dbnalert.send_dbn_alerts = True |