added processing events by day

This commit is contained in:
Fredrick W. Warren 2024-12-29 07:46:00 -07:00
parent f786cceed1
commit 889022c84c

10
main.py
View File

@ -133,6 +133,11 @@ def write_calendar(events: list[Event]) -> None:
writer.write()
def process_day(events, day_events):
"""process all events for one day"""
for event_item in day_events:
debug_print(f" {event_item}", DEBUG)
return events
def process_month(MONTHS, monthly_events, week_of_month, week, events):
"""process one MONTHS of events"""
@ -142,9 +147,10 @@ def process_month(MONTHS, monthly_events, week_of_month, week, events):
month, week_of_month, day_of_week, day
use monthly_events[day_of_week]
"""
debug_print(f" {day_of_week}-{day:02d}", DEBUG," ")
debug_print(f" {day_of_week}-{day:02d}", DEBUG)
day_events = [x[1:] for x in monthly_events[day_of_week] if week_of_month + 1 in x[0]]
debug_print(day_events, DEBUG)
# debug_print(day_events, DEBUG)
events = process_day(events, day_events)
debug_print("", DEBUG)
return events