Commit e7e96af6 authored by Lozac'h Loic's avatar Lozac'h Loic
Browse files

debug

parent f0c0bbfa
......@@ -113,8 +113,8 @@ class EodagS1Downloader():
products_availability[pp.properties["id"]] = [pp]
print(
f"Scihub has got {nbsci_online} ONLINE products over {estimated_scihub_of_results}"
f"PEPS has got {nbpeps_online} ONLINE products over {estimated_peps_of_results}"
f"\nScihub has got {nbsci_online} ONLINE products over {estimated_scihub_of_results}"
f"\nPEPS has got {nbpeps_online} ONLINE products over {estimated_peps_of_results}"
)
nb_dblav=0
......@@ -122,7 +122,7 @@ class EodagS1Downloader():
if len(products_availability[p]) == 1 :
print(
f"Product {p} is only available on {products_availability[p][0].provider}"
f"\nProduct {p} is only available on {products_availability[p][0].provider}"
)
else:
nb_dblav+=1
......@@ -137,8 +137,8 @@ class EodagS1Downloader():
allserialfile = os.path.join(downdir,nowstr+"_alldownloads.json")
remainserialfile = os.path.join(downdir,nowstr+"_remaindownloads.json")
while still2download:
for p in sorted(products_availability, key=len(products_availability.get), reverse=True):
print(f"Starting Download {p}...")
for p in sorted(products_availability, key=lambda k: len(products_availability[k]), reverse=True):
print(f"\nStarting Download {p}...")
with closing(StringIO()) as tqdm_out:
with ProgressCallback(file=tqdm_out) as bar:
products_availability[p][0].download( bar, extract=False, outputs_prefix=downdir)
......@@ -154,24 +154,24 @@ class EodagS1Downloader():
if len(products_downloaded) == nbProducts2d :
still2download = False
print(
f"All downloads successful."
f"Serializing search products to {allserialfile}"
f"Exiting."
f"\nAll downloads successful."
f"\nSerializing search products to {allserialfile}"
f"\nExiting."
)
elif nb_allretry == 5 :
still2download = False
print(
f"Max number of retries has been completed."
f"Serializing all search products to {allserialfile}"
f"Serializing remain search products to {remainserialfile}"
f"Exiting."
f"\nMax number of retries has been completed."
f"\nSerializing all search products to {allserialfile}"
f"\nSerializing remain search products to {remainserialfile}"
f"\nExiting."
)
else:
print(f"Pass n#{nb_allretry} has reached {len(products_downloaded)} over {nbProducts2d} expected")
print(f"Waiting {passwait[nb_allretry-1]} minutes before retrying...")
print(f"\nPass n#{nb_allretry} has reached {len(products_downloaded)} over {nbProducts2d} expected")
print(f"\nWaiting {passwait[nb_allretry-1]} minutes before retrying...")
restartd = datetime.now()+timedelta(minutes=passwait[nb_allretry-1])
restartstr = restartd.strftime("%Y/%m/%d-%H:%M:%S")
print(f"Restart at {restartstr}")
print(f"\nRestart at {restartstr}")
time.sleep(passwait[nb_allretry-1]*60)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment