diff --git a/src/getCalendar.py b/src/getCalendar.py index eef38aa..a442e63 100644 --- a/src/getCalendar.py +++ b/src/getCalendar.py @@ -44,10 +44,16 @@ if calendar: # Sort the events by start time events.sort(key=lambda x: datetime.datetime.strptime(x[0], "%d.%m.%Y %H:%M:%S")) + + # Remove Events with same summary + summarys = [] + for summary in events: + if summary[1] not in summarys: + summarys.append(summary[1]) # Print the sorted events - for summary in events: - print('-', summary[1]) + for summary in summarys: + print('-', summary) else: print('Calendar not found.') \ No newline at end of file