From 40ed226e53fddc2a436233149feea6ca2d0c5740 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 14 Nov 2012 17:00:30 +0200 Subject: Misc fixes to the QLocale data parser/generator Change-Id: I01589eae4e48bc1f484d54277de8f18262ca8f31 Reviewed-by: Lars Knoll --- util/local_database/xpathlite.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'util/local_database/xpathlite.py') diff --git a/util/local_database/xpathlite.py b/util/local_database/xpathlite.py index a9e309629e..5bea6ce63a 100644 --- a/util/local_database/xpathlite.py +++ b/util/local_database/xpathlite.py @@ -181,9 +181,13 @@ def _findEntryInFile(file, path, draft=None, attribute=None): return (elt.firstChild.nodeValue, None) def findAlias(file): - if not doc_cache.has_key(file): - return False - doc = doc_cache[file] + doc = False + if doc_cache.has_key(file): + doc = doc_cache[file] + else: + doc = xml.dom.minidom.parse(file) + doc_cache[file] = doc + alias_elt = findChild(doc.documentElement, "alias") if not alias_elt: return False @@ -242,7 +246,7 @@ def findEntry(base, path, draft=None, attribute=None): if result: return result if not aliaspath: - raise Error("findEntry: fatal error: %s: did not found key %s" % (filename, path)) + raise Error("findEntry: fatal error: %s: can not find key %s" % (filename, path)) path = aliaspath return result -- cgit v1.2.3