Back to index

salome-kernel  6.5.0
Public Member Functions | Public Attributes
appli_gen.xml_parser Class Reference

List of all members.

Public Member Functions

def __init__
def boolValue
def startElement
def endElement
def characters
def processingInstruction
def setDocumentLocator
def startDocument
def endDocument

Public Attributes

 space
 config
 current
 read

Detailed Description

Definition at line 58 of file appli_gen.py.


Constructor & Destructor Documentation

def appli_gen.xml_parser.__init__ (   self,
  fileName 
)

Definition at line 59 of file appli_gen.py.

00059 
00060     def __init__(self, fileName ):
00061         print "Configure parser: processing %s ..." % fileName
00062         self.space = []
00063         self.config = {}
00064         self.config["modules"] = []
00065         self.config["guimodules"] = []
00066         parser = xml.sax.make_parser()
00067         parser.setContentHandler(self)
00068         parser.parse(fileName)
00069         pass


Member Function Documentation

def appli_gen.xml_parser.boolValue (   self,
  str 
)

Definition at line 70 of file appli_gen.py.

00070 
00071     def boolValue( self, str ):
00072         if str in ("yes", "y", "1"):
00073             return 1
00074         elif str in ("no", "n", "0"):
00075             return 0
00076         else:
00077             return str
00078         pass

def appli_gen.xml_parser.characters (   self,
  content 
)

Definition at line 117 of file appli_gen.py.

00117 
00118     def characters(self, content):
00119         pass

Definition at line 130 of file appli_gen.py.

00130 
00131     def endDocument(self):
00132         self.read = None
00133         pass
00134 
00135 # -----------------------------------------------------------------------------

def appli_gen.xml_parser.endElement (   self,
  name 
)

Definition at line 112 of file appli_gen.py.

00112 
00113     def endElement(self, name):
00114         p = self.space.pop()
00115         self.current = None
00116         pass

def appli_gen.xml_parser.processingInstruction (   self,
  target,
  data 
)

Definition at line 120 of file appli_gen.py.

00120 
00121     def processingInstruction(self, target, data):
00122         pass

def appli_gen.xml_parser.setDocumentLocator (   self,
  locator 
)

Definition at line 123 of file appli_gen.py.

00123 
00124     def setDocumentLocator(self, locator):
00125         pass

Definition at line 126 of file appli_gen.py.

00126 
00127     def startDocument(self):
00128         self.read = None
00129         pass

def appli_gen.xml_parser.startElement (   self,
  name,
  attrs 
)

Definition at line 79 of file appli_gen.py.

00079 
00080     def startElement(self, name, attrs):
00081         self.space.append(name)
00082         self.current = None
00083         # --- if we are analyzing "prerequisites" element then store its "path" attribute
00084         if self.space == [appli_tag, prereq_tag] and path_att in attrs.getNames():
00085             self.config["prereq_path"] = attrs.getValue( path_att )
00086             pass
00087         # --- if we are analyzing "resources" element then store its "path" attribute
00088         if self.space == [appli_tag, resources_tag] and path_att in attrs.getNames():
00089             self.config["resources_path"] = attrs.getValue( path_att )
00090             pass
00091         # --- if we are analyzing "samples" element then store its "path" attribute
00092         if self.space == [appli_tag, samples_tag] and path_att in attrs.getNames():
00093             self.config["samples_path"] = attrs.getValue( path_att )
00094             pass
00095         # --- if we are analyzing "module" element then store its "name" and "path" attributes
00096         elif self.space == [appli_tag,modules_tag,module_tag] and \
00097             nam_att in attrs.getNames() and \
00098             path_att in attrs.getNames():
00099             nam = attrs.getValue( nam_att )
00100             path = attrs.getValue( path_att )
00101             gui = 1
00102             if gui_att in attrs.getNames():
00103                 gui = self.boolValue(attrs.getValue( gui_att ))
00104                 pass
00105             self.config["modules"].append(nam)
00106             self.config[nam]=path
00107             if gui:
00108                 self.config["guimodules"].append(nam)
00109                 pass
00110             pass
00111         pass


Member Data Documentation

Definition at line 62 of file appli_gen.py.

Definition at line 81 of file appli_gen.py.

Definition at line 127 of file appli_gen.py.

Definition at line 61 of file appli_gen.py.


The documentation for this class was generated from the following file: