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:
parent
97fe09811b
commit
0271166403
1 changed files with 5 additions and 1 deletions
|
@ -10,6 +10,7 @@ import xml.etree.ElementTree as ET
|
||||||
import iiab.iiab_const as CONST
|
import iiab.iiab_const as CONST
|
||||||
|
|
||||||
lang_codes = {}
|
lang_codes = {}
|
||||||
|
lang_iso2_codes = {}
|
||||||
|
|
||||||
def get_zim_list(path):
|
def get_zim_list(path):
|
||||||
'''
|
'''
|
||||||
|
@ -139,8 +140,11 @@ def read_lang_codes():
|
||||||
#print("menu.json:%s"%reads)
|
#print("menu.json:%s"%reads)
|
||||||
lang_codes = json.loads(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):
|
def calc_perma_ref(uri):
|
||||||
'''Given a path or url return the generic zim name'''
|
'''Given a path or url return the generic zim name'''
|
||||||
url_slash = uri.split('/')
|
url_slash = uri.split('/')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue