Blame 00-use_system_iso-codes.patch

2f51df6
# HG changeset patch
2f51df6
# User David Paleino <dapal@debian.org>
2f51df6
# Date 1544770987 18000
2f51df6
#      Fri Dec 14 02:03:07 2018 -0500
ae55f64
# Node ID e02a9eb90790c57ce107633dc4a03f70a4a6b5ae
ae55f64
# Parent  094324a0a9c7d0d7c2a060a1b17d4ecd8504beb3
2f51df6
Use system iso-codes.
2f51df6
2f51df6
diff --git a/src/pycountry/__init__.py b/src/pycountry/__init__.py
2f51df6
--- a/src/pycountry/__init__.py
2f51df6
+++ b/src/pycountry/__init__.py
ae55f64
@@ -13,8 +13,8 @@ except ImportError:
2f51df6
         return os.path.join(os.path.dirname(__file__), resource_name)
2f51df6
 
2f51df6
 
2f51df6
-LOCALES_DIR = resource_filename('pycountry', 'locales')
2f51df6
-DATABASE_DIR = resource_filename('pycountry', 'databases')
2f51df6
+LOCALES_DIR = '/usr/share/locale'
2f51df6
+DATABASE_DIR = '/usr/share/iso-codes/json'
2f51df6
 
2f51df6
 
ae55f64
 def remove_accents(input_str):
ae55f64
@@ -191,15 +191,15 @@ class Subdivisions(pycountry.db.Database
2f51df6
         return subdivisions
2f51df6
 
2f51df6
 
2f51df6
-countries = ExistingCountries(os.path.join(DATABASE_DIR, 'iso3166-1.json'))
ae55f64
-subdivisions = Subdivisions(os.path.join(DATABASE_DIR, 'iso3166-2.json'))
2f51df6
+countries = ExistingCountries(os.path.join(DATABASE_DIR, 'iso_3166-1.json'))
ae55f64
+subdivisions = Subdivisions(os.path.join(DATABASE_DIR, 'iso_3166-2.json'))
2f51df6
 historic_countries = HistoricCountries(
2f51df6
-    os.path.join(DATABASE_DIR, 'iso3166-3.json'))
2f51df6
+    os.path.join(DATABASE_DIR, 'iso_3166-3.json'))
ae55f64
 
ae55f64
-currencies = Currencies(os.path.join(DATABASE_DIR, 'iso4217.json'))
2f51df6
+currencies = Currencies(os.path.join(DATABASE_DIR, 'iso_4217.json'))
ae55f64
 
ae55f64
-languages = Languages(os.path.join(DATABASE_DIR, 'iso639-3.json'))
2f51df6
+languages = Languages(os.path.join(DATABASE_DIR, 'iso_639-3.json'))
ae55f64
 language_families = LanguageFamilies(
ae55f64
-    os.path.join(DATABASE_DIR, 'iso639-5.json'))
ae55f64
+    os.path.join(DATABASE_DIR, 'iso_639-5.json'))
ae55f64
 
ae55f64
-scripts = Scripts(os.path.join(DATABASE_DIR, 'iso15924.json'))
ae55f64
+scripts = Scripts(os.path.join(DATABASE_DIR, 'iso_15924.json'))
2f51df6
diff --git a/src/pycountry/tests/test_general.py b/src/pycountry/tests/test_general.py
2f51df6
--- a/src/pycountry/tests/test_general.py
2f51df6
+++ b/src/pycountry/tests/test_general.py
ae55f64
@@ -132,7 +132,7 @@ def test_language_families():
2f51df6
 
2f51df6
 def test_locales():
2f51df6
     german = gettext.translation(
2f51df6
-        'iso3166', pycountry.LOCALES_DIR, languages=['de'])
2f51df6
+        'iso_3166', pycountry.LOCALES_DIR, languages=['de'])
2f51df6
     german.install()
2f51df6
     assert __builtins__['_']('Germany') == 'Deutschland'
2f51df6