Use SecretLoader

This commit is contained in:
Jon Michael Aanes 2024-07-17 15:49:16 +02:00
parent 34d10270d6
commit f51f35b5c6
3 changed files with 5 additions and 6 deletions

View File

@ -18,4 +18,4 @@ advantage of the its e-ink screen, but I had problems getting it to run 24/7.
__all__ = ['__version__'] __all__ = ['__version__']
from _version import __version__ from ._version import __version__

View File

@ -2,9 +2,7 @@ import argparse
import bottle import bottle
import datetime import datetime
from . import google_calendar from . import (google_calendar, config)
import config
TEMPLATE_INDEX = bottle.SimpleTemplate(name = "templates/index.html") TEMPLATE_INDEX = bottle.SimpleTemplate(name = "templates/index.html")
@ -42,7 +40,8 @@ def render_calendar(events_map, today):
def get_events_map() -> tuple[dict[datetime.date, list[str]], datetime.date]: def get_events_map() -> tuple[dict[datetime.date, list[str]], datetime.date]:
today = datetime.date.today() today = datetime.date.today()
events_map = { } events_map = { }
for prefix, url in config.ICAL_LINKS.items(): for url in config.get_ical_links():
prefix = 'J '
for date, event in google_calendar.get_events_for_month(url, today): for date, event in google_calendar.get_events_for_month(url, today):
text = '{}: {}'.format(prefix, event.summary) text = '{}: {}'.format(prefix, event.summary)
events_map.setdefault(date, []).append(text) events_map.setdefault(date, []).append(text)

View File

@ -1,4 +1,4 @@
ical ical
requests_cache requests_cache
secret_loader @ git@gitfub.space:Jmaa/secret_loader.git secret_loader @ git+https://gitfub.space/Jmaa/secret_loader@main
bottle bottle