summaryrefslogtreecommitdiffstats
path: root/util/local_database/xpathlite.py
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-11-14 17:00:30 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-15 13:55:00 +0100
commit40ed226e53fddc2a436233149feea6ca2d0c5740 (patch)
tree82d901e3284ca2bf7ecf87b206b569bc01e86ee5 /util/local_database/xpathlite.py
parentfc271b4273c7ebfe2d08a6a29ec99c2f13ebb8cd (diff)
Misc fixes to the QLocale data parser/generator
Change-Id: I01589eae4e48bc1f484d54277de8f18262ca8f31 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'util/local_database/xpathlite.py')
-rw-r--r--util/local_database/xpathlite.py12
1 files changed, 8 insertions, 4 deletions
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