From 4075398236612336be52dd2931bedd54ac98f14d Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Thu, 4 Aug 2022 10:18:18 +0200 Subject: [PATCH] Change of URLs at Presto --- presto2gemini.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/presto2gemini.py b/presto2gemini.py index 2104065..aeb8ae1 100755 --- a/presto2gemini.py +++ b/presto2gemini.py @@ -20,7 +20,7 @@ import shutil # http://python-requests.org/ import requests -PRESTO_URL = "https://www.sidc.be/archive/product/presto" +PRESTO_URL = "https://www.sidc.be/spaceweatherservices/applications/archive/product/presto" SOURCE_URL = "https://forge.chapril.org/bortzmeyer/presto2gemini" # Defaults @@ -52,16 +52,16 @@ From the alerts sent by SIDC (Solar Influences Data analysis Center). for file in os.listdir(raw_dir): files.append(file) sorted_files = sorted(files, reverse=True) - fs = open("%s%s.txt" % (gem_dir, sorted_files[0]), "r") - print(""" + if len(sorted_files) != 0: + fs = open("%s%s.txt" % (gem_dir, sorted_files[0]), "r") + print(""" Last alert: %s """ % fs.read(), file=f) - fs.close() - for file in sorted(files, reverse=True): - print("=> %s.gmi Alert of %s" % (file, file), file=f) - + fs.close() + for file in sorted(files, reverse=True): + print("=> %s.gmi Alert of %s" % (file, file), file=f) print(""" ## Legal and contact