comparison Config.py @ 10:09b39021c4af

Make filename an attribute of file.
author Tom Fredrik Blenning Klaussen <bfg@blenning.no>
date Wed, 14 Nov 2012 21:44:53 +0100
parents 3a56cd936c59
children
comparison
equal deleted inserted replaced
9:2263a283203c 10:09b39021c4af
20 " is not a valid value for attribute match") 20 " is not a valid value for attribute match")
21 if prog.match(match): 21 if prog.match(match):
22 res = Config.getOption(potentialMatch, option, match) 22 res = Config.getOption(potentialMatch, option, match)
23 if not res: 23 if not res:
24 res = potentialMatch.getAttribute('cxxflags') 24 res = potentialMatch.getAttribute('cxxflags')
25 return res 25 return res
26 return None 26 return None
27 27
28 def getCxxflags(self, name): 28 def getCxxflags(self, name):
29 value = self.getOption(self.document.childNodes[0], 'Cxxflags', name) 29 value = self.getOption(self.document.childNodes[0], 'Cxxflags', name)
30 if value == None: 30 if value == None:
32 return value 32 return value
33 33
34 def getFiles(self): 34 def getFiles(self):
35 retVal = [] 35 retVal = []
36 for elem in self.document.getElementsByTagName('file'): 36 for elem in self.document.getElementsByTagName('file'):
37 for t in elem.childNodes: 37 if elem.hasAttribute('name'):
38 retVal.append(t.wholeText) 38 retVal.append(elem.getAttribute('name'))
39 else:
40 raise xml.dom.SyntaxErr("<file> must have a name attribute")
41
39 return retVal 42 return retVal