GoogleInterface.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:alfredToday 作者: jeeftor 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号