added processing events by day
This commit is contained in:
parent
f786cceed1
commit
889022c84c
10
main.py
10
main.py
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user