Public Member Functions | |
def | __init__ |
def | dumpPythonAs |
def | extract |
Private Attributes | |
_fromLabel |
An IncludeNode with a label, so it will only extract the named node, plus any IncludeNodes, which are presumed to be blocks
Definition at line 540 of file parseConfig.py.
def parseConfig::_IncludeFromNode::__init__ | ( | self, | ||
fromLabel, | ||||
filename | ||||
) |
Definition at line 544 of file parseConfig.py.
00544 : 00545 super(_IncludeFromNode,self).__init__(filename) 00546 self._fromLabel = fromLabel def extract(self, newLabel, otherFiles,recurseFiles,parser,validator,recursor):
def parseConfig::_IncludeFromNode::dumpPythonAs | ( | self, | ||
newLabel, | ||||
options | ||||
) |
Definition at line 570 of file parseConfig.py.
00570 : 00571 result = "import "+self.pythonModuleName() +"\n" 00572 result += newLabel + " = " 00573 result += self.pythonModuleName() + '.' + self._fromLabel+".clone()\n" 00574 return result 00575 00576 def _makeInclude(s,loc,toks):
def parseConfig::_IncludeFromNode::extract | ( | self, | ||
label, | ||||
otherFiles, | ||||
recurseFiles, | ||||
parser, | ||||
validator, | ||||
recursor | ||||
) |
reads in the file with name 'fileName' making sure it does not recursively include itself by looking in 'otherFiles' then applies the 'parser' to the contents of the file, runs the validator and then applies the recursor to see if other files must now be included
Reimplemented from parseConfig::_IncludeNode.
Definition at line 547 of file parseConfig.py.
00547 : 00548 import copy 00549 # First, expand everything, so blocks 00550 # don't worry about re-parsing 00551 wasHere = (self.filename in otherFiles) 00552 if wasHere: 00553 otherFiles.remove(self.filename) 00554 expandedValues = _IncludeNode.extract(self, newLabel, otherFiles,recurseFiles,parser,validator,recursor) 00555 # one possible fix to the issue of whether the original gets included 00556 if not wasHere: 00557 otherFiles.remove(self.filename) 00558 found = False 00559 for l,v in expandedValues: 00560 if l == self._fromLabel: 00561 found = True 00562 # I don't know how to replace it, so I'll just have to copy 00563 # second possbile fix is to comment this out 00564 expandedValues.remove((l,v)) 00565 expandedValues.append((newLabel, copy.deepcopy(v))) 00566 if not found: 00567 raise RuntimeError("the file "+self.filename+" does not contain a "+self._fromLabel 00568 +"\n from file "+_fileStack[-1]) 00569 return expandedValues def dumpPythonAs(self, newLabel, options):
Definition at line 546 of file parseConfig.py.