From edff5a5fa04afd7cef5ef23a81cdbb9e555fc910 Mon Sep 17 00:00:00 2001 From: Tim Moody Date: Mon, 23 Nov 2020 18:04:00 -0500 Subject: [PATCH 1/2] change read_library_xml defaults --- roles/pylibs/templates/iiab_lib.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/roles/pylibs/templates/iiab_lib.py b/roles/pylibs/templates/iiab_lib.py index afca02edf..2c8f0f43d 100644 --- a/roles/pylibs/templates/iiab_lib.py +++ b/roles/pylibs/templates/iiab_lib.py @@ -55,7 +55,7 @@ def get_zim_list(path): zim_versions[perma_ref] = zim_info # if there are multiples, last should win return files_processed, zim_versions -def read_library_xml(lib_xml_file, kiwix_exclude_attr=[""]): # duplicated from iiab-cmdsrv +def read_library_xml(lib_xml_file, kiwix_exclude_attr=["favicon"]): # duplicated from iiab-cmdsrv but changed ''' Read zim properties from library.xml Returns dict of library.xml and map of zim id to zim file name (under /library/zims) @@ -69,8 +69,7 @@ def read_library_xml(lib_xml_file, kiwix_exclude_attr=[""]): # duplicated from i path_to_id_map (dict): A dictionary that translates zim ids to physical names ''' - kiwix_exclude_attr.append("id") # don't include id - kiwix_exclude_attr.append("favicon") # don't include large favicon + kiwix_exclude_attr.append("id") # don't include id because is key zims_installed = {} path_to_id_map = {} try: From 8ae93cc8de74ff11c4c5fa596713105867aedc9a Mon Sep 17 00:00:00 2001 From: Tim Moody Date: Tue, 24 Nov 2020 09:22:54 -0500 Subject: [PATCH 2/2] allow icon to be included in zim cat --- roles/pylibs/templates/iiab_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/pylibs/templates/iiab_lib.py b/roles/pylibs/templates/iiab_lib.py index 2c8f0f43d..84dee97e3 100644 --- a/roles/pylibs/templates/iiab_lib.py +++ b/roles/pylibs/templates/iiab_lib.py @@ -107,7 +107,7 @@ def rem_libr_xml(zim_id, kiwix_library_xml): if e.returncode != 2: # skip bogus file open error in kiwix-manage print(outp) -def add_libr_xml(kiwix_library_xml, zim_path, zimname, zimidx): +def add_libr_xml(kiwix_library_xml, zim_path, zimname, zimidx=None): ''' Add a zim to library.xml