mirror of
https://github.com/b4tman/sync_ics2gcal
synced 2025-02-01 20:28:30 +00:00
make service even when config is None
This commit is contained in:
parent
41cc6b4159
commit
9aad7e1910
@ -44,20 +44,21 @@ class GoogleCalendarService():
|
||||
return service
|
||||
|
||||
@staticmethod
|
||||
def from_config(config):
|
||||
def from_config(config=None):
|
||||
"""make service Resource from config dict
|
||||
|
||||
Arguments:
|
||||
config -- dict() config with keys:
|
||||
(optional) service_account: - service account filename
|
||||
if key not in dict then default credentials will be used
|
||||
( https://developers.google.com/identity/protocols/application-default-credentials )
|
||||
( https://developers.google.com/identity/protocols/application-default-credentials )
|
||||
-- None: default credentials will be used
|
||||
|
||||
Returns:
|
||||
service Resource
|
||||
"""
|
||||
|
||||
if 'service_account' in config:
|
||||
if (not config is None) and 'service_account' in config:
|
||||
service = GoogleCalendarService.from_srv_acc_file(config['service_account'])
|
||||
else:
|
||||
service = GoogleCalendarService.default()
|
||||
|
Loading…
x
Reference in New Issue
Block a user