Add emojis to events

This commit is contained in:
Edward Betts 2023-11-23 22:05:53 +00:00
parent a8d36a55b0
commit a4e226ea03
7 changed files with 11 additions and 9 deletions

View file

@ -13,7 +13,8 @@ def get_events(filepath: str) -> list[Event]:
date=item["from"],
end_date=item["to"],
name="accommodation",
title=(
title="🧳"
+ (
f'{item["location"]} Airbnb'
if item["operator"] == "airbnb"
else item["name"]

View file

@ -3,7 +3,6 @@
from datetime import date
import yaml
from rich.pretty import pprint
from .types import Event
@ -34,7 +33,7 @@ def get_birthdays(from_date: date, filepath: str) -> list[Event]:
Event(
date=bday.replace(year=bday.year + offset),
name="birthday",
title=f'{entity["label"]} (aged {age + offset})',
title=f'🎈 {entity["label"]} (aged {age + offset})',
)
)

View file

@ -20,7 +20,7 @@ def get_list(filepath: str) -> list[Event]:
name="conference",
date=start_date,
end_date=end_date,
title=f'{conf["name"]} ({conf["location"]})',
title=f'🎤 {conf["name"]} ({conf["location"]})',
url=conf.get("url"),
)
events.append(event)

View file

@ -7,6 +7,8 @@ from dateutil.relativedelta import TH, relativedelta
from . import uk_time
from .types import Event
# emoji: 📰
def publication_dates(start_date: date, end_date: date) -> list[Event]:
"""List of Economist publication dates."""

View file

@ -21,7 +21,7 @@ def get_events(data_dir: str) -> list[Event]:
date=start,
end_date=end,
name="meetup",
title=item_event["title"],
title="👥" + item_event["title"],
url=item_event["eventUrl"],
)
events.append(e)

View file

@ -25,7 +25,7 @@ def get_flights(data_dir: str) -> list[Event]:
date=item["depart"],
end_date=item.get("arrive"),
name="transport",
title=f'flight from {item["from"]} to {item["to"]} ({flight_number(item)})',
title=f'✈️ {item["from"]} to {item["to"]} ({flight_number(item)})',
url=item.get("url"),
)
for item in parse_yaml("flights", data_dir)
@ -42,7 +42,7 @@ def get_trains(data_dir: str) -> list[Event]:
date=leg["depart"],
end_date=leg["arrive"],
name="transport",
title=f'train from {leg["from"]} to {leg["to"]}',
title=f'🚆 {leg["from"]} to {leg["to"]}',
url=item.get("url"),
)
for leg in item["legs"]

View file

@ -95,7 +95,7 @@ def parse(root: lxml.html.HtmlElement) -> list[Event]:
Event(
name="waste_schedule",
date=uk_time(d, time(6, 30)),
title="Backwell: " + ", ".join(services),
title="🗑️ Backwell: " + ", ".join(services),
)
for d, services in by_date.items()
]
@ -204,6 +204,6 @@ async def get_bristol_gov_uk(start_date: date, data_dir: str, uprn: str) -> list
by_date[d].append(service)
return [
Event(name="waste_schedule", date=d, title="Bristol: " + ", ".join(services))
Event(name="waste_schedule", date=d, title="🗑️ Bristol: " + ", ".join(services))
for d, services in by_date.items()
]