diff --git a/IndividualCalendar.py b/IndividualCalendar.py index f5852ef..3caf0a5 100644 --- a/IndividualCalendar.py +++ b/IndividualCalendar.py @@ -203,13 +203,6 @@ def process_individual_calendars(calendar, start_date, end_date): simple_events = SimpleEvent.create_event_for_individual_calendars(event, start_date, end_date, net_id) filtered_events.extend(simple_events) - if (net_id == "pttran3"): - print(event) - for a in simple_events: - print(a) - print("-----------------------------------------") - - except KeyError as e: logger.warning(f"Unable to find: " + net_id) diff --git a/SimpleEvent.py b/SimpleEvent.py index 504da3b..aaa17a6 100644 --- a/SimpleEvent.py +++ b/SimpleEvent.py @@ -53,33 +53,19 @@ def create_event_for_individual_calendars(cls, event, start_date, end_date, net_ # if an event goes in here, then it's all day because the start date and end date differ by one day so it has to be at least be 1 All Day # Automatically All Day dates_interval = end - start - - if (net_id == "pttran3"): - print(f"dates_interval: {dates_interval}") add_on = 0 remaining_hours = dates_interval.seconds // 3600 if (remaining_hours!= 0): - print("first add") add_on = add_on + 1 # if (start.time() >= ) - midnight_start_time = time(0, 0, 0, 0) - - if (net_id == "pttran3"): - print(f"midnight_start_time: {midnight_start_time}") - print(f"start time of event: {start.time()}") - + midnight_start_time = time(0, 0, 0, 0) if (start.time() != midnight_start_time and end.time() <= start.time()): - print("second add") - add_on = add_on + 1 - - if (net_id == "pttran3"): - print(f"Going over {dates_interval.days + add_on} days") - + add_on = add_on + 1 for i in range(dates_interval.days + add_on): # The plus accounts for the last day of the multiday event. Even if it's just one All-Day @@ -89,32 +75,20 @@ def create_event_for_individual_calendars(cls, event, start_date, end_date, net_ new_start = start + timedelta(days=i) new_end = end + timedelta(days=i) new_end = new_end.replace(year=new_start.year, month=new_start.month, day=new_start.day) - if (net_id == "pttran3"): - print(f"org new start: {new_start}") - print(f"org new end: {new_end}") - # Adjust the time so that we can create an accurate subject for the split up event # Manipulating the time for the simple event here if (i == 0): - #print("here 1") new_end = new_end.replace(hour=23,minute=59,second=59) elif (i == dates_interval.days + add_on - 1): - #print("here 2") new_start = new_start.replace(hour=0,minute=0,second=0) if (new_end.time() == midnight_start_time): new_end = new_end.replace(hour=23,minute=59,second=59) else: - #print("here 3") new_start = new_start.replace(hour=0,minute=0,second=0) new_end = new_end.replace(hour=23,minute=59,second=59) - if (net_id == "pttran3"): - print(f"new start: {new_start}") - print(f"new end: {new_end}") - print("++++++++++++++++++++++++++++++++++++++++++++") - if SimpleEvent.is_event_valid(start_date, end_date, new_start, new_end): events.append(cls(net_id, SimpleEvent.get_event_subject(new_start, new_end, net_id), new_start))