HWRF  trunk@4391
Functions | Variables
produtil.setup Namespace Reference

Contains setup(), which initializes the produtil package. More...

Detailed Description

Contains setup(), which initializes the produtil package.

This module contains the setup() function that should be called once by every Python process started, immediately after Python starts.

Functions

def setup (ignore_hup=False, dbnalert_logger=None, jobname=None, cluster=None, send_dbn=None, thread_logger=False, thread_stack=2 **24, kwargs)
 Initializes the produtil package. More...
 

Variables

list __all__ = ['setup']
 Lists symbols exported by "from produtil.setup import *".
 

Function Documentation

def produtil.setup.setup (   ignore_hup = False,
  dbnalert_logger = None,
  jobname = None,
  cluster = None,
  send_dbn = None,
  thread_logger = False,
  thread_stack = 2**24,
  kwargs 
)

Initializes the produtil package.

Calls the module initialization functions for all other modules in the produtil package.

At present, it:

  1. Installs signal handlers that will cleanly abort the process.
  2. Sets up logging to the jlogfile, if $jlogfile is in the environment.
  3. Sets up logging to stdout and stderr.
  4. Sets up the produtil.dbnalert module so DBNAlert objects will function properly
  5. Sets the produtil.cluster's idea of what cluster it is on. If no cluster is specified, the produtil.cluster is instructed to guess.

This is a wrapper around the produtil.sigsafety, and produtil.log, and other module initializers. Note that one could call each module's initialization functions directly instead. However, one would have to keep up with changes to the produtil package during upgrades in order to do that.

Parameters
ignore_hupif True, this program will ignore SIGHUP. Use this for UNIX daemon processes. Turned off (False) by default, causing SIGHUP to be a terminal signal.
dbnalert_loggersent to dbnalert.init_module's logger argument to initialize the logging domain for informational messages about dbn alerts
jobnamedbn_alert job string
clusterif specified and not None, sent to produtil.cluster's set_cluster. Otherwise, produtil.cluster.where() is called to guess the cluster, or set suitable defaults.
send_dbnshould dbn alerts be sent?
thread_loggerif True, log messages will include thread name.
thread_stackpassed to threading.stack_size(); the stack size in bytes for new threads. The default is 2**24, which is 16 MB. See the threading module for details. Set to None to disable changing of the threading stack size.
kwargsall other keyword args sent to produtil.log.configureLogging()

Definition at line 15 of file setup.py.

Referenced by scripts.exhwrf_forecast.doit(), scripts.exhwrf_products.doit(), hwrf_scrub.Deleter.go(), pom.kick.kick(), scripts.exhwrf_ensda_pre.main(), scripts.exhwrf_unpost.main(), scripts.exhwrf_ensda_output.main(), scripts.exhwrf_ocean_init.main(), scripts.exhwrf_bufrprep.main(), scripts.exhwrf_gsi_post.main(), scripts.exhwrf_input.main(), scripts.exhwrf_merge.main(), scripts.exhwrf_gsi.main(), scripts.exhwrf_ensda.main(), scripts.exhwrf_relocate.main(), scripts.exhwrf_init.main(), scripts.exhwrf_launch.main(), scripts.exhwrf_check_init.main(), scripts.exhwrf_output.main(), scripts.exhwrf_para_archive.main_tape(), scripts.exhwrf_post.post(), and setup_hurricane.StormCurses.setup().