Table of Contents

Class: madTimeCalculatorService madTimeCalculatorService.py

madTimeCalculatorService is the class that allows remote access to the madTimeCalculator.py script.

Like all my python cgi scripts, madTimeCalculatorService has the following structure: the entire cgi is contained in one class, with a main function at the end which serves simply to call the __init__ function of the class. This __init__ function is responsible for calling all other class methods. It is made up of a single try block, with the purpose of reporting all exceptions in well-formatted text to both the user and the administrator. The __init__ function first makes sure the pythonlib can be found. It then calls setScriptState to validate the the cgi arguments, which are simply the arguments for the isprint command.

If any uncaught exception is thrown, its caught by the __init__ try block. If its an MadrigalError, additional information is available. The catch blocks attempt to display the error message on the screen by backing out of of large number of possible tags, which might prevent its display (in any case, the error message will always be available in the page source. The formatted error message is also sent to the email address given in the siteTab.txt metadata file.

This script is not meant to be used directly by a user, and thus is named Service. It is meant to be used by scripting languages such as Matlab that want to call madTimeCalculator via the web

Input cgi arguments:

  1. startyear - int (required)

  2. startmonth - int (required)

  3. startday - int (required)

  4. starthour - int (required)

  5. startmin - int (required)

  6. startsec - int (required)

  7. endyear - int (required)

  8. endmonth - int (required)

  9. endday - int (required)

  10. endhour - int (required)

  11. endmin - int (required)

  12. endsec - int (required)

  13. stephours - double - number of hours between each measurement (required)

  14. parms - comma delimited string of Madrigal parameters desired (required)

Returns comma-delimited data, one line for time, with the following fields:

  1. year

  2. month

  3. day

  4. hour

  5. min

  6. sec

  7. Values for each Madrigal parameter listed in argument parms, separated by whitespace

Calls script madTimeCalculator.py.

If error, returns error description

Change history:

Written by Bill Rideout July. 12, 2004

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

Methods   
__init__
createObjects
madTimeCalculator
setScriptState
  __init__ 
__init__ ( self )

__init__ run the entire madTimeCalculatorService script. All other functions are private and called by __init__.

Inputs: None

Returns: void

Affects: Ouputs madTimeCalculator data as a service.

Exceptions: None.

  createObjects 
createObjects ( self )

  madTimeCalculator 
madTimeCalculator ( self )

  setScriptState 
setScriptState ( self )


Table of Contents

This document was automatically generated on Thu Jan 19 13:26:16 2006 by HappyDoc version r1_5