1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Merge pull request #2099 from tim-moody/iiab-lib-iso2

add iso2 index to iiab_lib.py
This commit is contained in:
Tim Moody 2020-01-04 17:54:44 -05:00 committed by GitHub
commit 527c169084
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,7 @@ import xml.etree.ElementTree as ET
import iiab.iiab_const as CONST
lang_codes = {}
lang_iso2_codes = {}
def get_zim_list(path):
'''
@ -139,8 +140,11 @@ def read_lang_codes():
#print("menu.json:%s"%reads)
lang_codes = json.loads(reads)
# there is a different algorithm in get_zim_list above
# create iso2 index
for lang in lang_codes:
lang_iso2_codes[lang_codes[lang]['iso2'] ] = lang
# there is a different algorithm in get_zim_list above
def calc_perma_ref(uri):
'''Given a path or url return the generic zim name'''
url_slash = uri.split('/')