[open-ils-commits] r11498 - branches/rel_1_4/build/i18n/scripts
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Dec 10 11:30:51 EST 2008
Author: dbs
Date: 2008-12-10 11:30:49 -0500 (Wed, 10 Dec 2008)
New Revision: 11498
Modified:
branches/rel_1_4/build/i18n/scripts/merge_ils_events.py
Log:
Backport r11365 from trunk to handle exception in case of malformed input for ils_events.xml
Modified: branches/rel_1_4/build/i18n/scripts/merge_ils_events.py
===================================================================
--- branches/rel_1_4/build/i18n/scripts/merge_ils_events.py 2008-12-10 16:29:06 UTC (rev 11497)
+++ branches/rel_1_4/build/i18n/scripts/merge_ils_events.py 2008-12-10 16:30:49 UTC (rev 11498)
@@ -19,15 +19,19 @@
events = master_xml.getElementsByTagName('event')
for event in events:
- merged.documentElement.appendChild(merged.createTextNode("\n"))
- l10n_node = get_l10n_event_desc(l10n_xml, event.getAttribute('code'))
- for child in event.childNodes:
- if child.nodeName == 'desc':
- if child.getAttribute('xml:lang') == l10n_node.getAttribute('xml:lang'):
- event.removeChild(child)
- event.appendChild(l10n_node)
- merged.documentElement.appendChild(event)
- merged.documentElement.appendChild(merged.createTextNode("\n"))
+ try:
+ code = event.getAttribute('code')
+ merged.documentElement.appendChild(merged.createTextNode("\n"))
+ l10n_node = get_l10n_event_desc(l10n_xml, code)
+ for child in event.childNodes:
+ if child.nodeName == 'desc':
+ if child.getAttribute('xml:lang') == l10n_node.getAttribute('xml:lang'):
+ event.removeChild(child)
+ event.appendChild(l10n_node)
+ merged.documentElement.appendChild(event)
+ merged.documentElement.appendChild(merged.createTextNode("\n"))
+ except AttributeError:
+ print("%s probably has an <event> [%s] without a matching <desc> node" % (localization, code))
return merged
More information about the open-ils-commits
mailing list