Skip to content

Commit

Permalink
Merge pull request #92 from tim-moody/9-25-enh
Browse files Browse the repository at this point in the history
various fixes and enhancements
  • Loading branch information
tim-moody authored Sep 26, 2018
2 parents 5fb76ee + 3efcd2f commit 1f5a4b2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion roles/cmdsrv/files/iiab-cmdsrv
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,7 @@ def get_last_jobs_stat(cmd_info):
db_lock.acquire() # will block if lock is already held
try:
conn = sqlite3.connect(cmdsrv_dbpath)
cur = conn.execute ("SELECT jobs.rowid, job_command, job_output, job_status, strftime('%s',jobs.create_datetime), strftime('%s',last_update_datetime), strftime('%s','now'), cmd_msg FROM jobs, commands where cmd_rowid = commands.rowid ORDER BY jobs.rowid DESC LIMIT 30")
cur = conn.execute ("SELECT jobs.rowid, job_command, job_output, job_status, strftime('%s',jobs.create_datetime), strftime('%s',last_update_datetime), strftime('%s','now', 'localtime'), cmd_msg FROM jobs, commands where cmd_rowid = commands.rowid ORDER BY jobs.rowid DESC LIMIT 30")
last_jobs = cur.fetchall()
conn.close()
except sqlite3.Error, e:
Expand Down
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
2 changes: 1 addition & 1 deletion roles/cmdsrv/templates/scripts/get_oer2go_catalog
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ iiab_oer2go_catalog = {}

oer2go_cat_url = 'http://dev.worldpossible.org/cgi/json_api_v1.pl'
rachel_mods_url = "rsync://dev.worldpossible.org/rachelmods/"
iiab_cat_url = "http://medbox.iiab.me/catalog/iiab_catalog.json"
iiab_cat_url = "http://med.iiab.me/catalog/iiab_catalog.json"

# output files

Expand Down

0 comments on commit 1f5a4b2

Please sign in to comment.