Fix calendar URL is entered just once

This commit is contained in:
Dejvino 2026-02-01 20:34:28 +01:00
parent 6f5d744628
commit 042df5efc2

View File

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