utils.py 文件源码

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

项目:gee-gateway 作者: openforis 项目源码 文件源码
def initialize(ee_account='', ee_key_path='', ee_user_token=''):
    try:
        if ee_user_token:
            credentials = OAuth2Credentials(ee_user_token, None, None, None, None, None, None)
            ee.InitializeThread(credentials)
        elif ee_account and ee_key_path:
            credentials = ServiceAccountCredentials.from_p12_keyfile(
                service_account_email=ee_account,
                filename=ee_key_path,
                private_key_password='notasecret',
                scopes=ee.oauth.SCOPE + ' https://www.googleapis.com/auth/drive')
            ee.Initialize(credentials)
        else:
            ee.Initialize()
    except (EEException, TypeError):
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号