def getInspectionsStr(self, xml):
     xReader = XMLReader()
     xParser = XMLParser()
     tree = xReader.getTree(xml)
     XMLInspections = []
     if tree == None:
         print(ind, xml, "Failed to read.")
         return
     link, score, url, fil, ID = xParser.getInspectionDataWithId(tree)
     for i in range(len(link)):
         XMLInspections.append(Inspection(link[i], score[i], url[i], fil[i], ID[i]))
     return XMLInspections
 def getInspections(self, xmls):
     xReader = XMLReader()
     xParser = XMLParser()
     XMLInspections = []
     for ind, xml in enumerate(xmls):
         tree = xReader.getTree(xml)
         if tree == None:
             print(ind, xml, "Failed to read.")
             continue
         link, score, url, fil = xParser.getInspectionData(tree)
         for i in range(len(link)):
             XMLInspections.append(Inspection(link[i], score[i], url[i], fil[i]))
     return XMLInspections
Example #3
0
	def __init__(self, vote, voteId, skip = False):
		if skip:
			return
		self.vote = vote
		self.voteId = voteId

		xReader = XMLReader()
		xParser = XMLParser()
		confTree = xReader.getTree('xml/conf.xml')
		if confTree == None:
			print('Abort. Failed to read xml/conf.xml')
			exit()
		self.masterInspectionPath = xParser.getMIXML(confTree)
	def isReadable(self):
		xr = XMLReader()
		return xr.checkIfExists(self.path)