diff --git a/jobs/tasks.py b/jobs/tasks.py index 41e0c57..d192255 100644 --- a/jobs/tasks.py +++ b/jobs/tasks.py @@ -20,18 +20,21 @@ class TasksJob(Job): return "UKOLY DNE" def configure(self): - print("\n--- Configure Calendar URL ---") - print("To find your Google Calendar URL:") - print("1. Go to Settings > Select Calendar > Integrate calendar") - print("2. Copy 'Secret address in iCal format'") - print("-" * 30) - print("Enter the public or secret address in iCal format (.ics).") - print("Example: https://calendar.google.com/calendar/ical/.../basic.ics") - url = input("URL: ").strip() - if url: - with open('calendar_url.txt', 'w') as f: - f.write(url) - print("URL saved.") + if not os.path.exists('calendar_url.txt'): + print("\n--- Configure Calendar URL ---") + print("To find your Google Calendar URL:") + print("1. Go to Settings > Select Calendar > Integrate calendar") + print("2. Copy 'Secret address in iCal format'") + print("-" * 30) + print("Enter the public or secret address in iCal format (.ics).") + print("Example: https://calendar.google.com/calendar/ical/.../basic.ics") + url = input("URL: ").strip() + if url: + with open('calendar_url.txt', 'w') as f: + f.write(url) + print("URL saved.") + else: + print("\nCalendar URL is already configured (delete calendar_url.txt to reset).") print("-" * 30) try: