From 89d526e740a56a8c3303e5f80ad27681d930d303 Mon Sep 17 00:00:00 2001 From: "Curtis L. Olson" Date: Tue, 26 Sep 2017 06:30:50 -0500 Subject: [PATCH] Check if thumbnail exists in package before building thumbnail_url (which is never actually used by the way.) --- catalog/update-catalog.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/catalog/update-catalog.py b/catalog/update-catalog.py index ce84a03..cbb474c 100755 --- a/catalog/update-catalog.py +++ b/catalog/update-catalog.py @@ -144,7 +144,10 @@ def process_aircraft_dir(name, repo_path): package_node = catalog.make_aircraft_node(name, package, variants, download_base) download_url = download_base + name + '.zip' - thumbnail_url = download_base + 'thumbnails/' + name + '_' + package['thumbnail'] + if 'thumbnail' in package: + # this is never even used, but breaks the script by assuming + # all aircraft packages have thumbnails defined? + thumbnail_url = download_base + 'thumbnails/' + name + '_' + package['thumbnail'] # get cached md5sum if it exists md5sum = get_xml_text(md5sum_root.find(str('aircraft_' + name))) @@ -301,6 +304,7 @@ for scm in scm_list: continue # process each aircraft in turn + # print name, repo_path process_aircraft_dir(name, repo_path) # write out the master catalog file