1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

add iso2 index to iiab_lib.py

This commit is contained in:
Tim Moody 2020-01-04 17:53:20 -05:00
parent 97fe09811b
commit 0271166403

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('/')