[open-ils-commits] r11365 - trunk/build/i18n/scripts
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Nov 29 17:13:30 EST 2008
Author: dbs
Date: 2008-11-29 17:13:25 -0500 (Sat, 29 Nov 2008)
New Revision: 11365
Modified:
trunk/build/i18n/scripts/merge_ils_events.py
Log:
Catch a possible exception in case of malformed input
Modified: trunk/build/i18n/scripts/merge_ils_events.py
===================================================================
--- trunk/build/i18n/scripts/merge_ils_events.py 2008-11-28 17:59:32 UTC (rev 11364)
+++ trunk/build/i18n/scripts/merge_ils_events.py 2008-11-29 22:13:25 UTC (rev 11365)
@@ -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