Skip to content

Commit

Permalink
stop use of http://download.kiwix.org/portable/ as Kiwix intends to r…
Browse files Browse the repository at this point in the history
…emove it
  • Loading branch information
tim-moody committed Sep 26, 2018
1 parent f9632e1 commit 3efcd2f
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions roles/cmdsrv/templates/scripts/get_kiwix_catalog
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ kiwix_catalog = jsonPath + "/kiwix_catalog.json"
if verbose:
print "Starting xml download from Kiwix"

try:
xmlsrc = urllib2.urlopen(kiwixLibUrl)
portable_tree = ET.parse(xmlsrc)
xmlsrc.close()
if verbose:
print "library.xml received from Kiwix"
except (urllib2.URLError) as exc:
if verbose:
print "Error getting library.xml from Kiwix"
sys.stdout.write("GET-KIWIX-CAT ERROR - " + str(exc.reason))
sys.stdout.flush()
sys.exit(1)
# As of 9/26/2018 we stop using zims from http://download.kiwix.org/portable/ as Kiwix intends to remove it
#try:
# xmlsrc = urllib2.urlopen(kiwixLibUrl)
# portable_tree = ET.parse(xmlsrc)
# xmlsrc.close()
# if verbose:
# print "library.xml received from Kiwix"
#except (urllib2.URLError) as exc:
# if verbose:
# print "Error getting library.xml from Kiwix"
# sys.stdout.write("GET-KIWIX-CAT ERROR - " + str(exc.reason))
# sys.stdout.flush()
# sys.exit(1)

try:
xmlsrc = urllib2.urlopen(kiwixZimLibUrl)
Expand All @@ -86,7 +87,7 @@ zimCount = 0
def main():
global portable_list, zimCount
zimCount = 0
portable_list = xml_to_list(portable_tree.getroot())
# portable_list = xml_to_list(portable_tree.getroot())
#zim_dict = xml_to_dict(zim_tree.getroot())
#portable_dict = xml_to_dict(portable_tree.getroot())

Expand Down

0 comments on commit 3efcd2f

Please sign in to comment.