Mercurial > code > home > repos > gcalendarwatch
changeset 72:c4230f701df9
repurpose the deleter for v5 events
author | drewp@bigasterisk.com |
---|---|
date | Fri, 06 Sep 2024 17:32:07 -0700 |
parents | 0f09464d4974 |
children | 50ddf6a48816 |
files | create_school_cals_2.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/create_school_cals_2.py Fri Sep 06 17:30:58 2024 -0700 +++ b/create_school_cals_2.py Fri Sep 06 17:32:07 2024 -0700 @@ -22,10 +22,14 @@ for item in res['items']: if item['description'] != desc: continue + dt = datetime.datetime.strptime(item['start']['dateTime'], '%Y-%m-%dT%H:%M:%S%z') + if dt.weekday() != 1: + continue yield item['id'] s = datetime.datetime(2024, 8, 1, tzinfo=tzlocal.get_localzone()) e = datetime.datetime(2025, 7, 1, tzinfo=tzlocal.get_localzone()) -for id in find(calIdForPerson['asher'], s=s, e=e, desc="auto-gen v3"): - service.events().delete(calendarId=calIdForPerson['asher'], eventId=id).execute() +for id in find(calIdForPerson['ari'], s=s, e=e, desc="auto-gen v5"): + print(id) + service.events().delete(calendarId=calIdForPerson['ari'], eventId=id).execute()