[Python-modules-commits] r30318 - in packages/django-countries/trunk/debian/patches (1 file)

fladi-guest at users.alioth.debian.org fladi-guest at users.alioth.debian.org
Thu Aug 28 19:33:40 UTC 2014


    Date: Thursday, August 28, 2014 @ 19:33:39
  Author: fladi-guest
Revision: 30318

Update patch to use iso-codes package data to new ustream code.

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	2014-08-28 19:33:25 UTC (rev 30317)
+++ packages/django-countries/trunk/debian/patches/use_iso_codes_package.patch	2014-08-28 19:33:39 UTC (rev 30318)
@@ -9,76 +9,543 @@
 Forwarded: not-needed
 Last-Update: 2011-11-17
 
---- a/django_countries/settings.py
-+++ b/django_countries/settings.py
-@@ -1,3 +1,4 @@
-+import os
- from django.conf import settings
+--- a/django_countries/data.py
++++ b/django_countries/data.py
+@@ -3,6 +3,7 @@
+ from __future__ import unicode_literals
+ import glob
+ import os
++from xml.dom.minidom import parse
  
+ try:
+     from django.utils.translation import ugettext_lazy as _
+@@ -10,258 +11,277 @@
+     # Allows this module to be executed without Django installed.
+     _ = lambda x: x
  
-@@ -11,5 +12,11 @@
-         prefix = '%s/' % prefix
-     return '%s%s' % (prefix, url)
- 
-+def _build_iso_xml():
+-# Nicely titled (and translatable) country names.
+-COUNTRIES = {
+-    "AF": _("Afghanistan"),
+-    "AX": _("Ã…land Islands"),
+-    "AL": _("Albania"),
+-    "DZ": _("Algeria"),
+-    "AS": _("American Samoa"),
+-    "AD": _("Andorra"),
+-    "AO": _("Angola"),
+-    "AI": _("Anguilla"),
+-    "AQ": _("Antarctica"),
+-    "AG": _("Antigua and Barbuda"),
+-    "AR": _("Argentina"),
+-    "AM": _("Armenia"),
+-    "AW": _("Aruba"),
+-    "AU": _("Australia"),
+-    "AT": _("Austria"),
+-    "AZ": _("Azerbaijan"),
+-    "BS": _("Bahamas"),
+-    "BH": _("Bahrain"),
+-    "BD": _("Bangladesh"),
+-    "BB": _("Barbados"),
+-    "BY": _("Belarus"),
+-    "BE": _("Belgium"),
+-    "BZ": _("Belize"),
+-    "BJ": _("Benin"),
+-    "BM": _("Bermuda"),
+-    "BT": _("Bhutan"),
+-    "BO": _("Bolivia, Plurinational State of"),
+-    "BQ": _("Bonaire, Sint Eustatius and Saba"),
+-    "BA": _("Bosnia and Herzegovina"),
+-    "BW": _("Botswana"),
+-    "BV": _("Bouvet Island"),
+-    "BR": _("Brazil"),
+-    "IO": _("British Indian Ocean Territory"),
+-    "BN": _("Brunei Darussalam"),
+-    "BG": _("Bulgaria"),
+-    "BF": _("Burkina Faso"),
+-    "BI": _("Burundi"),
+-    "KH": _("Cambodia"),
+-    "CM": _("Cameroon"),
+-    "CA": _("Canada"),
+-    "CV": _("Cape Verde"),
+-    "KY": _("Cayman Islands"),
+-    "CF": _("Central African Republic"),
+-    "TD": _("Chad"),
+-    "CL": _("Chile"),
+-    "CN": _("China"),
+-    "CX": _("Christmas Island"),
+-    "CC": _("Cocos (Keeling) Islands"),
+-    "CO": _("Colombia"),
+-    "KM": _("Comoros"),
+-    "CG": _("Congo"),
+-    "CD": _("Congo (the Democratic Republic of the)"),
+-    "CK": _("Cook Islands"),
+-    "CR": _("Costa Rica"),
+-    "CI": _("Côte d'Ivoire"),
+-    "HR": _("Croatia"),
+-    "CU": _("Cuba"),
+-    "CW": _("Curaçao"),
+-    "CY": _("Cyprus"),
+-    "CZ": _("Czech Republic"),
+-    "DK": _("Denmark"),
+-    "DJ": _("Djibouti"),
+-    "DM": _("Dominica"),
+-    "DO": _("Dominican Republic"),
+-    "EC": _("Ecuador"),
+-    "EG": _("Egypt"),
+-    "SV": _("El Salvador"),
+-    "GQ": _("Equatorial Guinea"),
+-    "ER": _("Eritrea"),
+-    "EE": _("Estonia"),
+-    "ET": _("Ethiopia"),
+-    "FK": _("Falkland Islands  [Malvinas]"),
+-    "FO": _("Faroe Islands"),
+-    "FJ": _("Fiji"),
+-    "FI": _("Finland"),
+-    "FR": _("France"),
+-    "GF": _("French Guiana"),
+-    "PF": _("French Polynesia"),
+-    "TF": _("French Southern Territories"),
+-    "GA": _("Gabon"),
+-    "GM": _("Gambia (The)"),
+-    "GE": _("Georgia"),
+-    "DE": _("Germany"),
+-    "GH": _("Ghana"),
+-    "GI": _("Gibraltar"),
+-    "GR": _("Greece"),
+-    "GL": _("Greenland"),
+-    "GD": _("Grenada"),
+-    "GP": _("Guadeloupe"),
+-    "GU": _("Guam"),
+-    "GT": _("Guatemala"),
+-    "GG": _("Guernsey"),
+-    "GN": _("Guinea"),
+-    "GW": _("Guinea-Bissau"),
+-    "GY": _("Guyana"),
+-    "HT": _("Haiti"),
+-    "HM": _("Heard Island and McDonald Islands"),
+-    "VA": _("Holy See  [Vatican City State]"),
+-    "HN": _("Honduras"),
+-    "HK": _("Hong Kong"),
+-    "HU": _("Hungary"),
+-    "IS": _("Iceland"),
+-    "IN": _("India"),
+-    "ID": _("Indonesia"),
+-    "IR": _("Iran (the Islamic Republic of)"),
+-    "IQ": _("Iraq"),
+-    "IE": _("Ireland"),
+-    "IM": _("Isle of Man"),
+-    "IL": _("Israel"),
+-    "IT": _("Italy"),
+-    "JM": _("Jamaica"),
+-    "JP": _("Japan"),
+-    "JE": _("Jersey"),
+-    "JO": _("Jordan"),
+-    "KZ": _("Kazakhstan"),
+-    "KE": _("Kenya"),
+-    "KI": _("Kiribati"),
+-    "KP": _("Korea (the Democratic People's Republic of)"),
+-    "KR": _("Korea (the Republic of)"),
+-    "KW": _("Kuwait"),
+-    "KG": _("Kyrgyzstan"),
+-    "LA": _("Lao People's Democratic Republic"),
+-    "LV": _("Latvia"),
+-    "LB": _("Lebanon"),
+-    "LS": _("Lesotho"),
+-    "LR": _("Liberia"),
+-    "LY": _("Libya"),
+-    "LI": _("Liechtenstein"),
+-    "LT": _("Lithuania"),
+-    "LU": _("Luxembourg"),
+-    "MO": _("Macao"),
+-    "MK": _("Macedonia (the former Yugoslav Republic of)"),
+-    "MG": _("Madagascar"),
+-    "MW": _("Malawi"),
+-    "MY": _("Malaysia"),
+-    "MV": _("Maldives"),
+-    "ML": _("Mali"),
+-    "MT": _("Malta"),
+-    "MH": _("Marshall Islands"),
+-    "MQ": _("Martinique"),
+-    "MR": _("Mauritania"),
+-    "MU": _("Mauritius"),
+-    "YT": _("Mayotte"),
+-    "MX": _("Mexico"),
+-    "FM": _("Micronesia (the Federated States of)"),
+-    "MD": _("Moldova (the Republic of)"),
+-    "MC": _("Monaco"),
+-    "MN": _("Mongolia"),
+-    "ME": _("Montenegro"),
+-    "MS": _("Montserrat"),
+-    "MA": _("Morocco"),
+-    "MZ": _("Mozambique"),
+-    "MM": _("Myanmar"),
+-    "NA": _("Namibia"),
+-    "NR": _("Nauru"),
+-    "NP": _("Nepal"),
+-    "NL": _("Netherlands"),
+-    "NC": _("New Caledonia"),
+-    "NZ": _("New Zealand"),
+-    "NI": _("Nicaragua"),
+-    "NE": _("Niger"),
+-    "NG": _("Nigeria"),
+-    "NU": _("Niue"),
+-    "NF": _("Norfolk Island"),
+-    "MP": _("Northern Mariana Islands"),
+-    "NO": _("Norway"),
+-    "OM": _("Oman"),
+-    "PK": _("Pakistan"),
+-    "PW": _("Palau"),
+-    "PS": _("Palestine, State of"),
+-    "PA": _("Panama"),
+-    "PG": _("Papua New Guinea"),
+-    "PY": _("Paraguay"),
+-    "PE": _("Peru"),
+-    "PH": _("Philippines"),
+-    "PN": _("Pitcairn"),
+-    "PL": _("Poland"),
+-    "PT": _("Portugal"),
+-    "PR": _("Puerto Rico"),
+-    "QA": _("Qatar"),
+-    "RE": _("Réunion"),
+-    "RO": _("Romania"),
+-    "RU": _("Russian Federation"),
+-    "RW": _("Rwanda"),
+-    "BL": _("Saint Barthélemy"),
+-    "SH": _("Saint Helena, Ascension and Tristan da Cunha"),
+-    "KN": _("Saint Kitts and Nevis"),
+-    "LC": _("Saint Lucia"),
+-    "MF": _("Saint Martin (French part)"),
+-    "PM": _("Saint Pierre and Miquelon"),
+-    "VC": _("Saint Vincent and the Grenadines"),
+-    "WS": _("Samoa"),
+-    "SM": _("San Marino"),
+-    "ST": _("Sao Tome and Principe"),
+-    "SA": _("Saudi Arabia"),
+-    "SN": _("Senegal"),
+-    "RS": _("Serbia"),
+-    "SC": _("Seychelles"),
+-    "SL": _("Sierra Leone"),
+-    "SG": _("Singapore"),
+-    "SX": _("Sint Maarten (Dutch part)"),
+-    "SK": _("Slovakia"),
+-    "SI": _("Slovenia"),
+-    "SB": _("Solomon Islands"),
+-    "SO": _("Somalia"),
+-    "ZA": _("South Africa"),
+-    "GS": _("South Georgia and the South Sandwich Islands"),
+-    "SS": _("South Sudan"),
+-    "ES": _("Spain"),
+-    "LK": _("Sri Lanka"),
+-    "SD": _("Sudan"),
+-    "SR": _("Suriname"),
+-    "SJ": _("Svalbard and Jan Mayen"),
+-    "SZ": _("Swaziland"),
+-    "SE": _("Sweden"),
+-    "CH": _("Switzerland"),
+-    "SY": _("Syrian Arab Republic"),
+-    "TW": _("Taiwan (Province of China)"),
+-    "TJ": _("Tajikistan"),
+-    "TZ": _("Tanzania, United Republic of"),
+-    "TH": _("Thailand"),
+-    "TL": _("Timor-Leste"),
+-    "TG": _("Togo"),
+-    "TK": _("Tokelau"),
+-    "TO": _("Tonga"),
+-    "TT": _("Trinidad and Tobago"),
+-    "TN": _("Tunisia"),
+-    "TR": _("Turkey"),
+-    "TM": _("Turkmenistan"),
+-    "TC": _("Turks and Caicos Islands"),
+-    "TV": _("Tuvalu"),
+-    "UG": _("Uganda"),
+-    "UA": _("Ukraine"),
+-    "AE": _("United Arab Emirates"),
+-    "GB": _("United Kingdom"),
+-    "US": _("United States"),
+-    "UM": _("United States Minor Outlying Islands"),
+-    "UY": _("Uruguay"),
+-    "UZ": _("Uzbekistan"),
+-    "VU": _("Vanuatu"),
+-    "VE": _("Venezuela, Bolivarian Republic of"),
+-    "VN": _("Viet Nam"),
+-    "VG": _("Virgin Islands (British)"),
+-    "VI": _("Virgin Islands (U.S.)"),
+-    "WF": _("Wallis and Futuna"),
+-    "EH": _("Western Sahara"),
+-    "YE": _("Yemen"),
+-    "ZM": _("Zambia"),
+-    "ZW": _("Zimbabwe"),
+-}
++ISO_XML_PATH = '/usr/share/xml/iso-codes/iso_3166.xml'
++
++try:
++    from django.conf import settings
++except ImportError:
++    # Django is not installed, so keep the default path.
++    pass
++else:
 +    if hasattr(settings, 'COUNTRIES_ISO_XML'):
-+        return settings.COUNTRIES_ISO_XML
-+    else:
-+        return '/usr/share/xml/iso-codes/iso_3166.xml'
++        ISO_XML_PATH = settings.COUNTRIES_ISO_XML
++
++# If the ISO-3166 XMl file is available, use it to generate a list of contry codes
++# and names.
++if os.path.isfile(ISO_XML_PATH):
++    COUNTRIES = {}
++    for node in sorted(parse(ISO_XML_PATH).getElementsByTagName('iso_3166_entry'),
++                    key=lambda node: node.getAttribute('name')):
++        COUNTRIES[node.getAttribute('alpha_2_code')] = _(node.getAttribute('name'))
++else:
++    # Nicely titled (and translatable) country names.
++    COUNTRIES = {
++        "AF": _("Afghanistan"),
++        "AX": _("Ã…land Islands"),
++        "AL": _("Albania"),
++        "DZ": _("Algeria"),
++        "AS": _("American Samoa"),
++        "AD": _("Andorra"),
++        "AO": _("Angola"),
++        "AI": _("Anguilla"),
++        "AQ": _("Antarctica"),
++        "AG": _("Antigua and Barbuda"),
++        "AR": _("Argentina"),
++        "AM": _("Armenia"),
++        "AW": _("Aruba"),
++        "AU": _("Australia"),
++        "AT": _("Austria"),
++        "AZ": _("Azerbaijan"),
++        "BS": _("Bahamas"),
++        "BH": _("Bahrain"),
++        "BD": _("Bangladesh"),
++        "BB": _("Barbados"),
++        "BY": _("Belarus"),
++        "BE": _("Belgium"),
++        "BZ": _("Belize"),
++        "BJ": _("Benin"),
++        "BM": _("Bermuda"),
++        "BT": _("Bhutan"),
++        "BO": _("Bolivia, Plurinational State of"),
++        "BQ": _("Bonaire, Sint Eustatius and Saba"),
++        "BA": _("Bosnia and Herzegovina"),
++        "BW": _("Botswana"),
++        "BV": _("Bouvet Island"),
++        "BR": _("Brazil"),
++        "IO": _("British Indian Ocean Territory"),
++        "BN": _("Brunei Darussalam"),
++        "BG": _("Bulgaria"),
++        "BF": _("Burkina Faso"),
++        "BI": _("Burundi"),
++        "KH": _("Cambodia"),
++        "CM": _("Cameroon"),
++        "CA": _("Canada"),
++        "CV": _("Cape Verde"),
++        "KY": _("Cayman Islands"),
++        "CF": _("Central African Republic"),
++        "TD": _("Chad"),
++        "CL": _("Chile"),
++        "CN": _("China"),
++        "CX": _("Christmas Island"),
++        "CC": _("Cocos (Keeling) Islands"),
++        "CO": _("Colombia"),
++        "KM": _("Comoros"),
++        "CG": _("Congo"),
++        "CD": _("Congo (the Democratic Republic of the)"),
++        "CK": _("Cook Islands"),
++        "CR": _("Costa Rica"),
++        "CI": _("Côte d'Ivoire"),
++        "HR": _("Croatia"),
++        "CU": _("Cuba"),
++        "CW": _("Curaçao"),
++        "CY": _("Cyprus"),
++        "CZ": _("Czech Republic"),
++        "DK": _("Denmark"),
++        "DJ": _("Djibouti"),
++        "DM": _("Dominica"),
++        "DO": _("Dominican Republic"),
++        "EC": _("Ecuador"),
++        "EG": _("Egypt"),
++        "SV": _("El Salvador"),
++        "GQ": _("Equatorial Guinea"),
++        "ER": _("Eritrea"),
++        "EE": _("Estonia"),
++        "ET": _("Ethiopia"),
++        "FK": _("Falkland Islands  [Malvinas]"),
++        "FO": _("Faroe Islands"),
++        "FJ": _("Fiji"),
++        "FI": _("Finland"),
++        "FR": _("France"),
++        "GF": _("French Guiana"),
++        "PF": _("French Polynesia"),
++        "TF": _("French Southern Territories"),
++        "GA": _("Gabon"),
++        "GM": _("Gambia (The)"),
++        "GE": _("Georgia"),
++        "DE": _("Germany"),
++        "GH": _("Ghana"),
++        "GI": _("Gibraltar"),
++        "GR": _("Greece"),
++        "GL": _("Greenland"),
++        "GD": _("Grenada"),
++        "GP": _("Guadeloupe"),
++        "GU": _("Guam"),
++        "GT": _("Guatemala"),
++        "GG": _("Guernsey"),
++        "GN": _("Guinea"),
++        "GW": _("Guinea-Bissau"),
++        "GY": _("Guyana"),
++        "HT": _("Haiti"),
++        "HM": _("Heard Island and McDonald Islands"),
++        "VA": _("Holy See  [Vatican City State]"),
++        "HN": _("Honduras"),
++        "HK": _("Hong Kong"),
++        "HU": _("Hungary"),
++        "IS": _("Iceland"),
++        "IN": _("India"),
++        "ID": _("Indonesia"),
++        "IR": _("Iran (the Islamic Republic of)"),
++        "IQ": _("Iraq"),
++        "IE": _("Ireland"),
++        "IM": _("Isle of Man"),
++        "IL": _("Israel"),
++        "IT": _("Italy"),
++        "JM": _("Jamaica"),
++        "JP": _("Japan"),
++        "JE": _("Jersey"),
++        "JO": _("Jordan"),
++        "KZ": _("Kazakhstan"),
++        "KE": _("Kenya"),
++        "KI": _("Kiribati"),
++        "KP": _("Korea (the Democratic People's Republic of)"),
++        "KR": _("Korea (the Republic of)"),
++        "KW": _("Kuwait"),
++        "KG": _("Kyrgyzstan"),
++        "LA": _("Lao People's Democratic Republic"),
++        "LV": _("Latvia"),
++        "LB": _("Lebanon"),
++        "LS": _("Lesotho"),
++        "LR": _("Liberia"),
++        "LY": _("Libya"),
++        "LI": _("Liechtenstein"),
++        "LT": _("Lithuania"),
++        "LU": _("Luxembourg"),
++        "MO": _("Macao"),
++        "MK": _("Macedonia (the former Yugoslav Republic of)"),
++        "MG": _("Madagascar"),
++        "MW": _("Malawi"),
++        "MY": _("Malaysia"),
++        "MV": _("Maldives"),
++        "ML": _("Mali"),
++        "MT": _("Malta"),
++        "MH": _("Marshall Islands"),
++        "MQ": _("Martinique"),
++        "MR": _("Mauritania"),
++        "MU": _("Mauritius"),
++        "YT": _("Mayotte"),
++        "MX": _("Mexico"),
++        "FM": _("Micronesia (the Federated States of)"),
++        "MD": _("Moldova (the Republic of)"),
++        "MC": _("Monaco"),
++        "MN": _("Mongolia"),
++        "ME": _("Montenegro"),
++        "MS": _("Montserrat"),
++        "MA": _("Morocco"),
++        "MZ": _("Mozambique"),
++        "MM": _("Myanmar"),
++        "NA": _("Namibia"),
++        "NR": _("Nauru"),
++        "NP": _("Nepal"),
++        "NL": _("Netherlands"),
++        "NC": _("New Caledonia"),
++        "NZ": _("New Zealand"),
++        "NI": _("Nicaragua"),
++        "NE": _("Niger"),
++        "NG": _("Nigeria"),
++        "NU": _("Niue"),
++        "NF": _("Norfolk Island"),
++        "MP": _("Northern Mariana Islands"),
++        "NO": _("Norway"),
++        "OM": _("Oman"),
++        "PK": _("Pakistan"),
++        "PW": _("Palau"),
++        "PS": _("Palestine, State of"),
++        "PA": _("Panama"),
++        "PG": _("Papua New Guinea"),
++        "PY": _("Paraguay"),
++        "PE": _("Peru"),
++        "PH": _("Philippines"),
++        "PN": _("Pitcairn"),
++        "PL": _("Poland"),
++        "PT": _("Portugal"),
++        "PR": _("Puerto Rico"),
++        "QA": _("Qatar"),
++        "RE": _("Réunion"),
++        "RO": _("Romania"),
++        "RU": _("Russian Federation"),
++        "RW": _("Rwanda"),
++        "BL": _("Saint Barthélemy"),
++        "SH": _("Saint Helena, Ascension and Tristan da Cunha"),
++        "KN": _("Saint Kitts and Nevis"),
++        "LC": _("Saint Lucia"),
++        "MF": _("Saint Martin (French part)"),
++        "PM": _("Saint Pierre and Miquelon"),
++        "VC": _("Saint Vincent and the Grenadines"),
++        "WS": _("Samoa"),
++        "SM": _("San Marino"),
++        "ST": _("Sao Tome and Principe"),
++        "SA": _("Saudi Arabia"),
++        "SN": _("Senegal"),
++        "RS": _("Serbia"),
++        "SC": _("Seychelles"),
++        "SL": _("Sierra Leone"),
++        "SG": _("Singapore"),
++        "SX": _("Sint Maarten (Dutch part)"),
++        "SK": _("Slovakia"),
++        "SI": _("Slovenia"),
++        "SB": _("Solomon Islands"),
++        "SO": _("Somalia"),
++        "ZA": _("South Africa"),
++        "GS": _("South Georgia and the South Sandwich Islands"),
++        "SS": _("South Sudan"),
++        "ES": _("Spain"),
++        "LK": _("Sri Lanka"),
++        "SD": _("Sudan"),
++        "SR": _("Suriname"),
++        "SJ": _("Svalbard and Jan Mayen"),
++        "SZ": _("Swaziland"),
++        "SE": _("Sweden"),
++        "CH": _("Switzerland"),
++        "SY": _("Syrian Arab Republic"),
++        "TW": _("Taiwan (Province of China)"),
++        "TJ": _("Tajikistan"),
++        "TZ": _("Tanzania, United Republic of"),
++        "TH": _("Thailand"),
++        "TL": _("Timor-Leste"),
++        "TG": _("Togo"),
++        "TK": _("Tokelau"),
++        "TO": _("Tonga"),
++        "TT": _("Trinidad and Tobago"),
++        "TN": _("Tunisia"),
++        "TR": _("Turkey"),
++        "TM": _("Turkmenistan"),
++        "TC": _("Turks and Caicos Islands"),
++        "TV": _("Tuvalu"),
++        "UG": _("Uganda"),
++        "UA": _("Ukraine"),
++        "AE": _("United Arab Emirates"),
++        "GB": _("United Kingdom"),
++        "US": _("United States"),
++        "UM": _("United States Minor Outlying Islands"),
++        "UY": _("Uruguay"),
++        "UZ": _("Uzbekistan"),
++        "VU": _("Vanuatu"),
++        "VE": _("Venezuela, Bolivarian Republic of"),
++        "VN": _("Viet Nam"),
++        "VG": _("Virgin Islands (British)"),
++        "VI": _("Virgin Islands (U.S.)"),
++        "WF": _("Wallis and Futuna"),
++        "EH": _("Western Sahara"),
++        "YE": _("Yemen"),
++        "ZM": _("Zambia"),
++        "ZW": _("Zimbabwe"),
++    }
  
- FLAG_URL = _build_flag_url()
-+ISO_XML = _build_iso_xml()
---- a/django_countries/countries.py
-+++ b/django_countries/countries.py
-@@ -1,5 +1,35 @@
- from django.utils.translation import ugettext_lazy as _
  
-+import unicodedata
-+from xml.dom.minidom import parse
-+
-+from django_countries import settings
-+
-+
-+# Nicely titled (and translated) country names.
-+COUNTRIES = []
-+COUNTRIES_PLUS = []
-+OFFICIAL_COUNTRIES = {}
-+
-+def _sort_key(s):
-+    return unicodedata.normalize('NFD', s).encode('ASCII', 'ignore')
-+
-+for node in sorted(parse(settings.ISO_XML).getElementsByTagName('iso_3166_entry'),
-+                   key=lambda node: _sort_key(node.getAttribute('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()
-+
-+COUNTRIES_PLUS = [(_code, _(_name)) for (_code, _name) in sorted(COUNTRIES_PLUS, key=lambda node: _sort_key(node[1]))]
-+
-+'''
-+# Upstream shipped static lists of countries.
-+from django.utils.translation import ugettext_lazy as _
-+
- # Nicely titled (and translatable) country names.
- COUNTRIES = (
-     ('AF', _(u'Afghanistan')),
-@@ -775,3 +805,5 @@
-     'ZM': u'ZAMBIA',
-     'ZW': u'ZIMBABWE',
- }
-+'''
-+
---- a/setup.py
-+++ b/setup.py
-@@ -28,7 +28,6 @@
-     packages=find_packages(),
-     zip_safe=False,
-     package_data={'django_countries': [
--        'locale/*/LC_MESSAGES/*',
-     ]},
-     # titlecase PYPI is broken, copied the module directly for now (in /bin)
-     #      requires=['titlecase'],
+ def self_generate(output_filename, filename='iso3166-1.csv'):




More information about the Python-modules-commits mailing list