updated all formatting.

This commit is contained in:
Lucas
2022-04-03 16:43:28 -04:00
parent 3d21f96959
commit 32df9bd9d3
4 changed files with 19 additions and 14 deletions
+7 -3
View File
@@ -1,5 +1,6 @@
from dateutil.parser import parse
class Event(object):
def __init__(self, summary, start_time, end_time):
@@ -10,8 +11,11 @@ class Event(object):
def __str__(self):
return f"summary : {self.summary}, end_time : {self.end_time}, start_time : {self.start_time}"
@staticmethod
def get_from_gcal_api_json(json):
print(json['start'].get('dateTime') )
return Event(json['summary'] if 'summary' in json else "No Title" , parse(json['start'].get('dateTime')), parse(json['end'].get('dateTime')))
print(json['start'].get('dateTime'))
return Event(
json['summary'] if 'summary' in json else "No Title",
parse(json['start'].get('dateTime')),
parse(json['end'].get('dateTime'))
)