Fix None checks for product history index

This commit is contained in:
Hoang Hong Quan
2025-03-23 13:56:36 +07:00
parent 7c121658fe
commit 08c21c8d8f
+3 -3
View File
@@ -197,7 +197,7 @@ class gatheringFiles:
product_history_index = self.get_product_index(download_history, product_name) product_history_index = self.get_product_index(download_history, product_name)
print("") print("")
if product_history_index == None: if product_history_index is None:
print("Please wait for download {}...".format(product_name)) print("Please wait for download {}...".format(product_name))
else: else:
if product_id == download_history[product_history_index].get("id"): if product_id == download_history[product_history_index].get("id"):
@@ -206,7 +206,7 @@ class gatheringFiles:
else: else:
print("Updating {}...".format(product_name)) print("Updating {}...".format(product_name))
if product_download_url: if product_download_url is not None:
print("from " + product_download_url) print("from " + product_download_url)
else: else:
print("Could not find download URL for {}.".format(product_name)) print("Could not find download URL for {}.".format(product_name))
@@ -221,7 +221,7 @@ class gatheringFiles:
self.fetcher.download_and_save_file(product_download_url, zip_path) self.fetcher.download_and_save_file(product_download_url, zip_path)
if not os.path.exists(zip_path): if not os.path.exists(zip_path):
if product_history_index: if product_history_index is not None:
print("Using previously version of {}.".format(product_name)) print("Using previously version of {}.".format(product_name))
continue continue
else: else: