Skip to content

Commit

Permalink
Fix dup issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PhongT16 committed Nov 13, 2023
1 parent b99a463 commit 19f54bc
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions OutlookCalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,43 +102,16 @@ def main(configs):

for group in [group_members[i : i + grouping] for i in range(0, len(group_members), grouping)]:
individual_calendars = IndividualCalendar.get_individual_calendars(start_date, end_date, group, access_token)
#print("Retrieved Individual Calendars from Outlook")
#print(individual_calendars)
individual_calendars_events.extend(IndividualCalendar.process_individual_calendars(individual_calendars, start_date, end_date))

logger.debug(f"Number of individual_calendars_events: {len(individual_calendars_events)}")
# print("")
logger.debug("individual_calendars_events: ")
for e in individual_calendars_events:
logger.debug(e)

logger.debug("")
logger.debug("----------------------------------------------")
logger.debug("")

# Retrieve the shared calendar and process it
debug_calendar = "NCSA Shared Calendar Two"
# shared_calendar_id = SharedCalendar.get_shared_calendar_id(configs['shared_calendar_name'], access_token)
shared_calendar_id = SharedCalendar.get_shared_calendar_id(debug_calendar, access_token)
shared_calendar_id = SharedCalendar.get_shared_calendar_id(configs['shared_calendar_name'], access_token)
shared_calendar = SharedCalendar.get_shared_calendar(shared_calendar_id, start_date, end_date, access_token)
#print("Retrieved Shared Calendar from Outlook")
#print(shared_calendar)
shared_calendar_events, event_ids = SharedCalendar.process_shared_calendar(shared_calendar, group_members)


logger.debug(f"Number of shared_calendar_events: {len(shared_calendar_events)}")
for e in shared_calendar_events:
logger.debug(e)

logger.debug("")
# print("----------------------------------------------")

# Update the shared calendar
SharedCalendar.update_shared_calendar(individual_calendars_events, shared_calendar_events, event_ids, shared_calendar_id, configs['category_name'], configs['category_color'], access_token)

# print("")
logger.debug("*****************************************************")
# print("")
if args.manual_update: break

count = count + 1
Expand Down

0 comments on commit 19f54bc

Please sign in to comment.