This commit is contained in:
marco
2021-11-06 14:46:50 +01:00
parent aafb008d5a
commit 06239735f5
4 changed files with 13 additions and 10 deletions
+4 -3
View File
@@ -6,8 +6,9 @@
#
from __future__ import unicode_literals
from collections import namedtuple
from pkg_resources import resource_stream # @UnresolvedImport
# from pkg_resources import resource_stream # @UnresolvedImport
from . import basestr
import os, io
#: Script code to script name mapping
SCRIPTS = {}
@@ -18,10 +19,10 @@ SCRIPT_MATRIX = []
#: The namedtuple used in the :data:`SCRIPT_MATRIX`
IsoScript = namedtuple('IsoScript', ['code', 'number', 'name', 'french_name', 'pva', 'date'])
f = resource_stream('babelfish', 'data/iso15924-utf8-20131012.txt')
f = io.open(os.path.join(os.path.dirname(__file__), 'data/iso15924-utf8-20131012.txt'), encoding='utf-8')
f.readline()
for l in f:
l = l.decode('utf-8').strip()
l = l.strip()
if not l or l.startswith('#'):
continue
script = IsoScript._make(l.split(';'))