+ return self.packageslist
+
+ # prerequisites = True: give only packages matching the prerequisites
+ def fillPackagesIndexList(self, prerequisites = True):
+ self.packagesIndexlist = []
+ indexfileList = []
+
+ if not isinstance(self.directory, list):
+ self.directory = [self.directory]
+
+ for indexfile in os.listdir(self.directory[0]):
+ if indexfile.startswith("index"):
+ if indexfile.endswith("_en.xml"): #we first catch all english indexfiles
+ indexfileList.append(os.path.splitext(indexfile)[0][:-3])
+
+ if len(indexfileList):
+ for file in indexfileList:
+ neededFile = self.directory[0] + "/" + file
+ if self.language is not None:
+ if os.path.exists(neededFile + '_' + self.language + '.xml' ):
+ #print "translated index file found",neededFile + '_' + self.language + '.xml'
+ self.readIndex(self.directory[0] + "/", neededFile + '_' + self.language + '.xml')
+ else:
+ #print "reading original index file"
+ self.readIndex(self.directory[0] + "/", neededFile + '_en.xml')
+
+ if prerequisites:
+ for package in self.packagesIndexlist[:]:
+ if not self.prerequisiteMet(package[0]["prerequisites"]):
+ self.packagesIndexlist.remove(package)
+ return self.packagesIndexlist
+
+ # prerequisites = True: give only packages matching the prerequisites
+ def fillPackageDetails(self, details = None):
+ self.packageDetails = []
+ detailsfile = details
+ if not isinstance(self.directory, list):
+ self.directory = [self.directory]
+ self.readDetails(self.directory[0] + "/", self.directory[0] + "/" + detailsfile)
+ return self.packageDetails