| |
- Subsystem
class Subsystem |
|
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
| |