Table of Contents

Module: __bgReport ui/__bgReport.py

__bgReport is the module that runs in a separate process to create a background report.

__bgReport contains a number of constants that can be modified to change the rules for generating background reports. These constants are:

tempDir - the name of the temporary directory on the web server where the reports are saved. This directory is located directly beneath the html directory defined in madrigal.cfg as MAD + SERVERDOCABS.

numDays - the number of days a temporary report is kept on the web server before being deleted by this script when it runs. This script will delete all reports older than numDays each time it runs.

$Id: __bgReport.py.html 3304 2011-01-17 15:25:59Z brideout $

Functions   
__dropLock
__getFilterStrList
__getLock
  __dropLock 
__dropLock ( filename )

__dropLock is a private helper function that drops exclusive access to filename via a locking file.

Inputs: filename = the file that exclusive access is required to.

Returns: None

Affects: Removes file filename + .LCK as a lock mechanism

Exceptions: None.

  __getFilterStrList 
__getFilterStrList ( filterList )

__getFilterStrList is a private helper function that creates 6 list describing filters needed by _Madrec.getIsprintReport.

Inputs: filterList - list of filter strings as passed in by report.py (See report.py for description).

Returns: List of Six lists as follows:

  1. List giving filter types, len = # filters, items are 1,'*','/','+', or -

  2. List with mnemonics of filter parameter 1 (items = # filters)

  3. List with mnemonics of filter parameter 2 (items = # filters) (may be None)

  4. List with number of ranges per filter (items = # filters)

  5. List with doubles of filter lower limits (items = sum of number of ranges above)

  6. List with doubles of filter upper limits (items = sum of number of ranges above)

Exceptions: None.

  __getLock 
__getLock ( filename )

__getLock is a private helper function that provides exclusive access to filename via a locking file.

Inputs: filename = the file that exclusive access is required to.

Returns: None

Affects: Writes file filename + .LCK as a lock mechanism

Exceptions: MadrigalError thrown if unable to write lock file

Notes: Will sleep for 1 second at a time, for a maximum of 10 seconds if the file is not modified. After each second, it will check for the lock file to be removed or modified. If it was modified, it resets the count to 0 sec and starts counting again. After _MaxSleep counts it then assumes lock file is orphaned and returns. Orphaned file will be removed when dropLock is called.

Exceptions   
madrigal.admin.MadrigalError( "Unable to open " + filename + ".LCK as locking file ", None )

Table of Contents

This document was automatically generated on Tue Mar 17 10:13:25 2009 by HappyDoc version r1_5