updated all formatting.
This commit is contained in:
@@ -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'))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user