def __init__(self, wf):
"""Construct a new GoogleInterface. Checks Auth status and if unauthorized will prompt for authorization"""
self.HTTP_INSTANCE = httplib2.Http(**get_http_kw_args(wf))
self.log = wf.logger
self.wf = wf
self.CLIENT_SECRET_FILE = 'client_secret.json'
self.APPLICATION_NAME = 'Alfred Today'
self.SCOPES = 'https://www.googleapis.com/auth/calendar.readonly'
credentials = self._get_credentials()
if not credentials or credentials.invalid:
self._authorize_google()
http = credentials.authorize(self.HTTP_INSTANCE)
self.service = discovery.build('calendar', 'v3', http=http)
评论列表
文章目录