Parser — Converts an ADMIT project on disk to in-memory objects.¶
This module is for parsing the input xml files, both admit.xml and the general bdp xml files.
-
class
admit.xmlio.Parser.
Parser
(base, baseDir='', xmlFile='')[source]¶ Main XML parsing class.
This class parses the main xml file (usually admit.xml) and reads in all AT and ADMIT data. It then searches for all BDP’s in the working directory and subdirectories. These BDP files are then parsed and added to their parent ATs.
Parameters: base : ADMIT
Instance of the base ADMIT class to add everything to. No Default.
baseDir : str
The root directory of the admit tree. Default: “” (current dirctory).
xmlFile : str
The root admit xml file to parse. Default: “”.
Attributes
xmlFile (str) String for the xml file to parse. parser (SAX parser) The parser to use. admit (ADMIT) The instance of the ADMIT class to add everything to. baseDir (str) The root directory for working. tasks (List) A list of all AT’s found. userData (dict) Dictionary for user data. summaryData (dict) Summary data. flowmanager (FlowManager) Temporary FM for reading in the data. projmanager: dict Project ID to base directory map. Methods
addBDPtoAT
(bdp)Method to add a BDP to an AT. getSummary
()Return the local copy of the summaryData getTasks
()Return the list of AT’s that have been read in getflowmanager
()Return the local copy of the FlowManager parse
([doParse])Method that controls the parsing flow. -
addBDPtoAT
(bdp)[source]¶ Method to add a BDP to an AT. The AT is not specified, but the _taskid attribute of the BDP is used to identify the necessary AT.
Parameters: bdp : BDP
Any valid BDP, to be added to an existing AT.
Returns: None
-
getSummary
()[source]¶ Return the local copy of the summaryData
Parameters: None
Returns: summaryData
Copy of the local summaryData that was read in from XML.
-
getTasks
()[source]¶ Return the list of AT’s that have been read in
Parameters: None
Returns: List
List of the AT’s from the xml file
-