HWRF  trunk@4391
Classes | Functions | Variables
produtil.dbnalert Namespace Reference

This module runs the NCO dbn_alert program, or logs dbn_alert messages if run with dbn alerts disabled. More...

Detailed Description

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.
 

Function Documentation

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.

def produtil.dbnalert.init_dbn_alert (   send_dbn = None)
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.

Parameters
send_dbnDo 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.

Parameters
loggerEither a logging.Logger object to receive log messages, or the string name of a logger domain.
jobnameThe dbn_alert job string for this job.
send_dbnOptional. 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().

Variable Documentation

produtil.dbnalert.send_dbn_alerts = True

False = don't run dbn_alert.

Just log the alerts.

Definition at line 26 of file dbnalert.py.