text = "\n".join(transcript)
# check the last generated transcript
-with open("config/last", "r") as f:
- last = f.read()
-
-# quit if the transcript is the same as the last
-if last == text:
- print("no change!")
- quit()
-else:
- print("proceeding...")
+try:
+ with open("config/last", "r") as f:
+ last = f.read()
+
+ # quit if the transcript is the same as the last
+ if last == text:
+ print("no change!")
+ quit()
+ else:
+ print("New spaceweather issued!")
+except FileNotFoundError:
+ print("no previous spaceweather detected!")
+
+print("Generating new spaceweather...")
# write the raw transcript to a file
with open("config/last", "w") as f: f.write(text)