X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/5a28515971d93c45baef9fcccd34b5f6c6f3d4a4..4c1d3d2f5cf39f72bf85041a6ba6665350ea742e:/lib/python/Components/DreamInfoHandler.py diff --git a/lib/python/Components/DreamInfoHandler.py b/lib/python/Components/DreamInfoHandler.py index 6004e1f3..85e2b533 100755 --- a/lib/python/Components/DreamInfoHandler.py +++ b/lib/python/Components/DreamInfoHandler.py @@ -50,8 +50,10 @@ class InfoHandler(xml.sax.ContentHandler): prerequisites[name].append(str(attrs["type"])) if name == "info": + self.foundTranslation = None + self.data = "" if not attrs.has_key("language"): - self.printError(str(name) + " tag with no language attribute") + print "info tag with no language attribute" else: if attrs["language"] == 'en': # read default translations self.foundTranslation = False @@ -59,9 +61,6 @@ class InfoHandler(xml.sax.ContentHandler): elif attrs["language"] == self.language: self.foundTranslation = True self.data = "" - else: - self.foundTranslation = None - self.data = "" if name == "files": if attrs.has_key("type"): @@ -95,6 +94,8 @@ class InfoHandler(xml.sax.ContentHandler): self.attributes["name"] = str(attrs["name"].encode("utf-8")) if attrs.has_key("packagename"): self.attributes["packagename"] = str(attrs["packagename"].encode("utf-8")) + if attrs.has_key("packagetype"): + self.attributes["packagetype"] = str(attrs["packagetype"].encode("utf-8")) if attrs.has_key("shortdescription"): self.attributes["shortdescription"] = str(attrs["shortdescription"].encode("utf-8")) @@ -254,8 +255,8 @@ class DreamInfoHandler: for indexfile in os.listdir(self.directory[0]): if indexfile.startswith("index"): - if os.path.splitext(indexfile)[0][-3:-2] is not "_": #we first catch all non translated indexfiles - indexfileList.append(os.path.splitext(indexfile)[0]) + 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: @@ -266,7 +267,7 @@ class DreamInfoHandler: self.readIndex(self.directory[0] + "/", neededFile + '_' + self.language + '.xml') else: #print "reading original index file" - self.readIndex(self.directory[0] + "/", neededFile + '.xml') + self.readIndex(self.directory[0] + "/", neededFile + '_en.xml') if prerequisites: for package in self.packagesIndexlist[:]: