ct_gdrive_oauth2.py 文件源码

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

项目:ct_gdrive 作者: stanford-rc 项目源码 文件源码
def new_credentials():
    """Perform OAuth2 flow to obtain the new credentials.

    Return:
        Credentials, the obtained credential.
    """
    credential_path = os.path.join(args.creds_dir, 'ct_gdrive_creds.json')

    store = oauth2client.file.Storage(credential_path)
    credentials = store.get()

    if not credentials or credentials.invalid:
        flow = client.flow_from_clientsecrets(args.client_secret, SCOPES)
        flow.user_agent = APPLICATION_NAME
        credentials = tools.run_flow(flow, store, args)
        print('Storing credentials to ' + credential_path)
    return credentials
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号