ACSErrorChecker.ErrorDefinition
index
/alma/ACS-2016.6/ACSSW/lib/python/site-packages/ACSErrorChecker/ErrorDefinition.py

################################################################################################
# @(#) $Id: ErrorDefinition.py,v 1.8 2011/10/28 14:39:18 hsommer Exp $
#
#    ALMA - Atacama Large Millimiter Array
#    (c) Associated Universities, Inc. Washington DC, USA, 2001
#    (c) European Southern Observatory, 2002
#    Copyright by ESO (in the framework of the ALMA collaboration)
#    and Cosylab 2002, All rights reserved
#
#    This library is free software; you can redistribute it and/or
#    modify it under the terms of the GNU Lesser General Public
#    License as published by the Free Software Foundation; either
#    version 2.1 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 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#    Lesser General Public License for more details.
#
#    You should have received a copy of the GNU Lesser General Public
#    License along with this library; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
###############################################################################

 
Modules
       
_xmlplus

 
Classes
       
__builtin__.object
ErrorDefinition

 
class ErrorDefinition(__builtin__.object)
    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!)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
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