Commit 7fe4220f authored by John Stowers's avatar John Stowers

Tidy schema reading code

parent 2db07a30
3.2.2
* Dont die on malformed schemas
3.2.1
* Translation updates
* Ellipsize long strings - should fix window size issues
......
......@@ -42,18 +42,18 @@ class _GSettingsSchema:
if schema_name == schema.getAttribute("id"):
for key in schema.getElementsByTagName("key"):
#summary is compulsory, description is optional
summary = key.getElementsByTagName("summary")
#... in theory, but we should not barf on bad schemas ever
try:
summary_text = summary[0].childNodes[0].data
summary = key.getElementsByTagName("summary")[0].childNodes[0].data
except:
summary_text = ""
summary = ""
logging.warning("Schema %s missing summary text: %s" % (schema_path, key.toxml()))
try:
description = key.getElementsByTagName("description")[0].childNodes[0].data
except:
description = ""
self._schema[key.getAttribute("name")] = {
"summary" : summary_text,
"summary" : summary,
"description" : description
}
except:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment