Blob Blame Raw
From 988372ed85d7317c2f24a956d50e78542728e575 Mon Sep 17 00:00:00 2001
From: Alon Levy <alon@pobox.com>
Date: Thu, 7 Aug 2014 18:33:48 +0300
Subject: [PATCH] pyphen 0.9.1 shared dicts

---
 pyphen.py | 19 ++-----------------
 setup.py  |  6 ------
 2 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/pyphen.py b/pyphen.py
index 4ea1499..06cadd8 100755
--- a/pyphen.py
+++ b/pyphen.py
@@ -42,23 +42,8 @@ hdcache = {}
 parse_hex = re.compile(r'\^{2}([0-9a-f]{2})').sub
 parse = re.compile(r'(\d?)(\D?)').findall
 
-# included dictionaries are available:
-# - at <sys.prefix>/share/pyphen/dictionaries when Pyphen is installed
-# - at <project_root>/dictionaries when Pyphen is not installed
-# - at <pkg_resources>/share/pyphen/dictionaries when Pyphen is in an egg
-try:
-    import pkg_resources
-except ImportError:
-    dictionaries_roots = ()
-else:
-    dictionaries_roots = (os.path.join(
-        pkg_resources.resource_filename('pyphen', ''),
-        'share', 'pyphen', 'dictionaries'),)
-finally:
-    dictionaries_roots += (
-        os.path.join(sys.prefix, 'share', 'pyphen', 'dictionaries'),
-        os.path.join(os.path.dirname(__file__), 'dictionaries'))
-
+# dictionaries provided by hyphen-xx RPM packages, e.g. hyphen-en
+dictionaries_roots = ['/usr/share/hyphen']
 
 LANGUAGES = dict(
     (filename[5:-4], os.path.join(dictionaries_root, filename))
diff --git a/setup.py b/setup.py
index 94022ab..fc54e24 100755
--- a/setup.py
+++ b/setup.py
@@ -21,17 +21,11 @@ classifiers = [
     'Topic :: Text Processing :: Linguistic',
 ]
 
-_dict_folder = os.path.join(os.path.dirname(__file__), 'dictionaries')
 setup(
     name='Pyphen',
     version='0.9.1',
     py_modules=['pyphen'],
     provides=['pyphen'],
-    data_files=[(
-        os.path.join('share', 'pyphen', 'dictionaries'), (
-            os.path.join(_dict_folder, filename)
-            for filename in os.listdir(_dict_folder)
-            if filename.endswith('.dic')))],
     author='Guillaume Ayoub',
     author_email='guillaume.ayoub@kozea.fr',
     url='https://github.com/Kozea/Pyphen',
-- 
1.9.3