ACSErrorChecker.ErrorDefinition
index
/diska/alma_tmp/ACS/LGPL/CommonSoftware/acserr/ws/src/ACSErrorChecker/ErrorDefinition.py

# @(#) $Id: ErrorDefinition.py,v 1.6.54.1 2008/11/12 15:30:34 acaproni Exp $
#
# Copyright (C) 2001
# Associated Universities, Inc. Washington DC, USA.
#
# Produced for the ALMA project
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Library General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option) any
# later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
# details.
#
# You should have received a copy of the GNU Library General Public License
# adouble with this library; if not, write to the Free Software Foundation, Inc.,
# 675 Massachusetts Ave, Cambridge, MA 02139, USA.  Correspondence concerning
# ALMA should be addressed as follows:
#
# Internet email: alma-sw-admin@nrao.edu
# "@(#) $Id: ErrorDefinition.py,v 1.6.54.1 2008/11/12 15:30:34 acaproni Exp $"
#
# who       when        what
# --------  ----------  ----------------------------------------------
# acaproni  2005/02/08  Created.
#------------------------------------------------------------------------------

 
Modules
       
_xmlplus

 
Classes
       
ErrorDefinition

 
class ErrorDefinition
    The errors definitions read by the xml file
If the xml file is not a file of errors it contains a null list of errors
 
The error has a name then a set of three values defining each type of errors
(see the xml file for further details)
Each error definition is composed by a dictionary of three values
    * code
    * sort description
    * description
So the data struct is a list of dictionaries
 
  Methods defined here:
__init__(self, xmlFile)
getCodes(self)
getErrors(self)
getFile(self)
getName(self)
getNumber(self)
isValid(self)
The error is valid if the file was parsed OK 
and the internal variables were filled
printError(self)
Nicely print the info about this error in the stdout (no html here!)

 
Functions
       
char_data(data)
Handler for parsing with expat
end_element(name)
Handler for parsing with expat
parseFile(fileName)
Parse the file
It set name to the name of the error
and errors as a list of errors (of the same type)
Return a list composed by
    * The name of the error
    * the type
    * the list of defined errors
    * the list of defined codes
start_element(name, attrs)
Handler for parsing with expat
 
Type must be Type the first time then ErrCode otherwise
the file is not of the right type

 
Data
        theCodes = None
theErrors = None
theName = None
theNumber = None
theTag = None