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:
commit
527c169084
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
|
||||
|
||||
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('/')
|
||||
|
|
Loading…
Reference in a new issue