spec dosyası işleme. Şimdilik pisi-build'de işimizi görecek kadar
düzenledim.
This commit is contained in:
+13
-7
@@ -29,11 +29,7 @@ from a PSPEC file"""
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def getFirstChildText(self, nodepath):
|
def getNodeText(self, node):
|
||||||
node = self.getFirstNode(nodepath)
|
|
||||||
if not node:
|
|
||||||
return None
|
|
||||||
|
|
||||||
# get the first child
|
# get the first child
|
||||||
try:
|
try:
|
||||||
child = node.childNodes[0]
|
child = node.childNodes[0]
|
||||||
@@ -43,8 +39,18 @@ from a PSPEC file"""
|
|||||||
if child.nodeType == child.TEXT_NODE:
|
if child.nodeType == child.TEXT_NODE:
|
||||||
return child.data
|
return child.data
|
||||||
|
|
||||||
def getAttribute(self, nodepath, attribute):
|
def getFirstChildText(self, nodepath):
|
||||||
pass
|
node = self.getFirstNode(nodepath)
|
||||||
|
if not node:
|
||||||
|
return None
|
||||||
|
|
||||||
|
return self.getNodeText(node)
|
||||||
|
|
||||||
|
def getNodeAttribute(self, node, attrname):
|
||||||
|
for i in range(node.attributes.length):
|
||||||
|
attr = node.attributes.item(i)
|
||||||
|
if attr.name == attrname:
|
||||||
|
return attr.childNodes[0].data
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
Reference in New Issue
Block a user