Table of Contents

Class: MadrigalNotify admin.py

MadrigalNotify is an object used to send messages to an administrator about a Madrigal database.

This object provides functions needed to send messages to an administrator about a Madrigal database, for now only sendAlert, which sends an email to the site administrator found is siteTab.txt (or if not possible, the admin in madrigal.cfg, and finally if all else fails, to root).

Usage example:

        import madrigal.admin

        try:

            adminObj =  madrigal.admin.MadrigalNotify()
            adminObj.sendAlert('This is important!', 'Important Message')

        except madrigal.admin.MadrigalError, e:

            print e.getExceptionStr()

Non-standard Python modules used: None

Exceptions thrown: None - Note that MadrigalNotify tries every trick it knows to avoid throwing exceptions, since this is the class that will generally be called when there is a problem.

Change history:

Written by Bill Rideout Dec. 4, 2001

Methods   
__init__
notify
sendAlert
  __init__ 
__init__ ( self,  madDB=None )

__init__ initializes MadrigalNotify by getting some basic information from MadrigalDB and MadrigalSite.

Note that MadrigalNotify tries every trick it knows to avoid throwing exceptions, since this is the class that will generally be called when there is a problem.

Inputs: Existing MadrigalDB object, by default = None.

Returns: void

Affects: Initializes self.__binDir.

Exceptions: None.

  notify 
notify (
        self,
        email,
        message,
        subject,
        )

notify sends an email with the given message and title to email.

Inputs: email (string), message (string), and subject (string)

Returns: void

Affects: none

Exceptions: None.

  sendAlert 
sendAlert (
        self,
        message,
        subject=None,
        )

sendAlert sends an email with the given message and optional title.

Inputs: message (string), and optional title (string)

Returns: void

Affects: none

Exceptions: None.


Table of Contents

This document was automatically generated on Thu Oct 20 16:51:50 2011 by HappyDoc version r1_5