Compare commits
2 commits
645957288d
...
2d224783b2
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d224783b2 | |||
| d124d0d2ea |
1 changed files with 6 additions and 7 deletions
13
web_view.py
13
web_view.py
|
|
@ -14,7 +14,8 @@ import time
|
||||||
import traceback
|
import traceback
|
||||||
import typing
|
import typing
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from datetime import date, datetime, timedelta, timezone
|
from datetime import date
|
||||||
|
from datetime import datetime, timedelta, timezone
|
||||||
from zoneinfo import ZoneInfo
|
from zoneinfo import ZoneInfo
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
|
|
@ -25,8 +26,8 @@ import yaml
|
||||||
from authlib.integrations.flask_client import OAuth
|
from authlib.integrations.flask_client import OAuth
|
||||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
|
|
||||||
import agenda.data
|
|
||||||
import agenda.conference
|
import agenda.conference
|
||||||
|
import agenda.data
|
||||||
import agenda.error_mail
|
import agenda.error_mail
|
||||||
import agenda.fx
|
import agenda.fx
|
||||||
import agenda.holidays
|
import agenda.holidays
|
||||||
|
|
@ -38,7 +39,7 @@ import agenda.trip_schengen
|
||||||
import agenda.uk_school_holiday
|
import agenda.uk_school_holiday
|
||||||
import agenda.utils
|
import agenda.utils
|
||||||
import agenda.weather
|
import agenda.weather
|
||||||
from agenda import ical, calendar, format_list_with_ampersand, travel, uk_tz
|
from agenda import calendar, format_list_with_ampersand, ical, travel, uk_tz
|
||||||
from agenda.event import Event
|
from agenda.event import Event
|
||||||
from agenda.types import StrDict, Trip
|
from agenda.types import StrDict, Trip
|
||||||
|
|
||||||
|
|
@ -632,8 +633,7 @@ def build_conference_ical(items: list[StrDict]) -> bytes:
|
||||||
ical.append_property(lines, "DTSTAMP", ical.format_datetime_utc(generated))
|
ical.append_property(lines, "DTSTAMP", ical.format_datetime_utc(generated))
|
||||||
ical.append_property(lines, "DTSTART;VALUE=DATE", ical.format_date(start_date))
|
ical.append_property(lines, "DTSTART;VALUE=DATE", ical.format_date(start_date))
|
||||||
ical.append_property(lines, "DTEND;VALUE=DATE", ical.format_date(end_exclusive))
|
ical.append_property(lines, "DTEND;VALUE=DATE", ical.format_date(end_exclusive))
|
||||||
summary = ical.escape_text(f"conference: {conf['name']}")
|
ical.append_property(lines, "SUMMARY", ical.escape_text(conf["name"]))
|
||||||
ical.append_property(lines, "SUMMARY", summary)
|
|
||||||
description = ical.escape_text(_conference_description(conf))
|
description = ical.escape_text(_conference_description(conf))
|
||||||
ical.append_property(lines, "DESCRIPTION", description)
|
ical.append_property(lines, "DESCRIPTION", description)
|
||||||
if location := _conference_location(conf):
|
if location := _conference_location(conf):
|
||||||
|
|
@ -854,7 +854,6 @@ def sum_co2_by_transport_type(trips: list[Trip]) -> list[tuple[str, float]]:
|
||||||
|
|
||||||
def get_home_weather() -> list[StrDict]:
|
def get_home_weather() -> list[StrDict]:
|
||||||
"""Get Bristol home weather forecast, with date objects added for templates."""
|
"""Get Bristol home weather forecast, with date objects added for templates."""
|
||||||
from datetime import date as date_type
|
|
||||||
|
|
||||||
forecasts = agenda.weather.get_forecast(
|
forecasts = agenda.weather.get_forecast(
|
||||||
app.config["DATA_DIR"],
|
app.config["DATA_DIR"],
|
||||||
|
|
@ -864,7 +863,7 @@ def get_home_weather() -> list[StrDict]:
|
||||||
cache_only=True,
|
cache_only=True,
|
||||||
)
|
)
|
||||||
for f in forecasts:
|
for f in forecasts:
|
||||||
f["date_obj"] = date_type.fromisoformat(f["date"])
|
f["date_obj"] = date.fromisoformat(f["date"])
|
||||||
return forecasts
|
return forecasts
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue