[Python-modules-commits] r19340 - in packages/django-countries/trunk/debian/patches (1 file)
fladi-guest at users.alioth.debian.org
fladi-guest at users.alioth.debian.org
Wed Nov 16 07:46:31 UTC 2011
Date: Wednesday, November 16, 2011 @ 07:46:30
Author: fladi-guest
Revision: 19340
Update iso-codes patch to do correct sorting and lazy translation.
Modified:
packages/django-countries/trunk/debian/patches/use_iso_codes_package.patch
Modified: packages/django-countries/trunk/debian/patches/use_iso_codes_package.patch
===================================================================
--- packages/django-countries/trunk/debian/patches/use_iso_codes_package.patch 2011-11-16 07:45:53 UTC (rev 19339)
+++ packages/django-countries/trunk/debian/patches/use_iso_codes_package.patch 2011-11-16 07:46:30 UTC (rev 19340)
@@ -47,15 +47,15 @@
+
+for node in sorted(parse(settings.ISO_XML).getElementsByTagName('iso_3166_entry'),
+ key=lambda node: _sort_key(node.getAttribute('name'))):
-+ _code = node.getAttribute('alpha_2_code')
-+ _name = _(node.getAttribute('name'))
-+ COUNTRIES.append((_code, _name))
++ _code = str(node.getAttribute('alpha_2_code'))
++ _name = node.getAttribute('name')
++ COUNTRIES.append((_code, _(_name)))
+ COUNTRIES_PLUS.append((_code, _name))
+ if _name.find(', ') >= 0:
+ COUNTRIES_PLUS.append((_code, ' '.join(reversed(_name.split(', ')))))
-+ OFFICIAL_COUNTRIES[_code.upper()] = _name.upper()
++ OFFICIAL_COUNTRIES[_code.upper()] = _(_name.upper())
+
-+COUNTRIES_PLUS = sorted(COUNTRIES_PLUS, key=lambda node: node[1])
++COUNTRIES_PLUS = [(_code, _(_name)) for (_code, _name) in sorted(COUNTRIES_PLUS, key=lambda node: _sort_key(node[1]))]
+
+'''
+# Upstream shipped static lists of countries.
More information about the Python-modules-commits
mailing list