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

################################################################################################
# @(#) $Id: Subsystem.py,v 1.18 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
###############################################################################
# --------  ----------  ----------------------------------------------
# acaproni  2005/02/08  Created.
#------------------------------------------------------------------------------

 
Modules
       
fpformat
glob
os
re
string
sys
time
_xmlplus

 
Classes
       
__builtin__.object
Subsystem

 
class Subsystem(__builtin__.object)
    The object to scan a subsystem.
It assumes that the base directory contains 
all the sources of the subsystem
 
name is the name of the subsystem
basedir is the base directory for the subsystem
min is the minimum allowed error number for this subsystem
max is the maximum allowed error number for this subsystem
ExaplesTestRange is the range for example and test errors
exclude is a list of directory trees to discard (CVS is a valid choice here)
include the directories to scan: if present only those folder
        are scanned for the files (idl is a valide choice here)
 
  Methods defined here:
__init__(self, name, basedir, min, max, exaplesAndTestsRange, exclude=['CVS'], include=None)
checkSubsystemErrors(self)
Scan the erros of the subsystem and insert in the list all the numbers
used by more than one error 
 
It also check for errors whose number is out of the range [min,max]
 
The errors with a number in the range allocated for test and examples 
are always assumed OK
 
Prerquisite: the errors are ordered by their number
excluded(self, name)
Check if name is valid i.e. not part of the excluded
generateErrorDetailsHTMLPage(self, error, fileName)
Generate the HTML with the detail of a single error
generateHTMLForDetailedError(self, error, fontStyle, endFontStyle)
Return an html string for the passed error
The html is a row of the table <TR><TD>....</TD><TR>
generateHTMLForError(self, error, fontStyle, endFontStyle, offset, fileName)
Return an html string for the passed error
The html generated is a table of errors
 
error is the error to scan
fontstyle and endFontStyle are used to color the wrong errors
offset is used to generate the name of the sub pages (that describe
           the details of each error)
generateHTMLForErrorMember(self, error, fontStyle, endFontStyle)
Return an HTML string of the Members of the error (if any)
generateHTMLPage(self, fileName)
Generate the main HTML page for the errors
The page is written into a file of the given name (filename)
If fileName is None the page is written in the stdout
For ach error described in this page there is a link to another HTML page
with the detailed info about that error
getHTMLFooter(self)
Return the footer of an HTML page
getHTMLHeader(self, errorStr)
Return the header of an HTML page (either the main page and the 
error description page)
    error is a string with the name of a specific error; if it is None 
    it means that the header is for the main page
included(self, name)
Check if name is a directory defined in include
insertFileContent(self, fileName)
Return an HTML string with the content of the
file with name fileName
The string represents the verbatim content of the file
isErrorDefFile(self, fileName)
Check if fileName contains an error definition.
It must be an xml file with the right format
orderErrors(self)
Order the errors by their number
parseXMLFiles(self, xmlFiles)
Parse all the xml files and bild a list of error definitions
xmlFiles is the list of xml files to parse
return a list of ErrorDefinition objects
printErrors(self)
Nicely print the info about this subsystem in 
the stdout (no html here!)
 
Note: - this output is not defined as the html is.
      - the user shoud read the out by himself to found errors
scans(self, dir)
Scans the base directory looking for the
xml files defining erros
writeHTMLOnFile(self, page, fileName)
page if an string with the HTML page to write in the file
fileName is the name of the file
If fileName is None the page is written in the stdout

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

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