From a4e226ea035706182aa185fd1f624e91d7d50c4f Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Thu, 23 Nov 2023 22:05:53 +0000 Subject: [PATCH] Add emojis to events --- agenda/accommodation.py | 3 ++- agenda/birthday.py | 3 +-- agenda/conference.py | 2 +- agenda/economist.py | 2 ++ agenda/meetup.py | 2 +- agenda/travel.py | 4 ++-- agenda/waste_schedule.py | 4 ++-- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/agenda/accommodation.py b/agenda/accommodation.py index 08b4501..23b4f0b 100644 --- a/agenda/accommodation.py +++ b/agenda/accommodation.py @@ -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"] diff --git a/agenda/birthday.py b/agenda/birthday.py index 13c81ac..a847a79 100644 --- a/agenda/birthday.py +++ b/agenda/birthday.py @@ -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})', ) ) diff --git a/agenda/conference.py b/agenda/conference.py index f29e05e..2e60d6f 100644 --- a/agenda/conference.py +++ b/agenda/conference.py @@ -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) diff --git a/agenda/economist.py b/agenda/economist.py index 4438b98..a13f7fd 100644 --- a/agenda/economist.py +++ b/agenda/economist.py @@ -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.""" diff --git a/agenda/meetup.py b/agenda/meetup.py index 3330e52..ab80d16 100644 --- a/agenda/meetup.py +++ b/agenda/meetup.py @@ -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) diff --git a/agenda/travel.py b/agenda/travel.py index bc1771d..4825c9c 100644 --- a/agenda/travel.py +++ b/agenda/travel.py @@ -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"] diff --git a/agenda/waste_schedule.py b/agenda/waste_schedule.py index c013362..4f4dade 100644 --- a/agenda/waste_schedule.py +++ b/agenda/waste_schedule.py @@ -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() ]