本文整理匯總了Python中oauth2client.client.OAuth2Credentials.from_json方法的典型用法代碼示例。如果您正苦於以下問題:Python OAuth2Credentials.from_json方法的具體用法?Python OAuth2Credentials.from_json怎麽用?Python OAuth2Credentials.from_json使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類oauth2client.client.OAuth2Credentials
的用法示例。
在下文中一共展示了OAuth2Credentials.from_json方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: locked_get
# 需要導入模塊: from oauth2client.client import OAuth2Credentials [as 別名]
# 或者: from oauth2client.client.OAuth2Credentials import from_json [as 別名]
def locked_get(self):
"""Retrieve the credentials from the dictionary, if they exist.
Returns: A :class:`oauth2client.client.OAuth2Credentials` instance.
"""
serialized = self._dictionary.get(self._key)
if serialized is None:
return None
credentials = OAuth2Credentials.from_json(serialized)
credentials.set_store(self)
return credentials
示例2: locked_get
# 需要導入模塊: from oauth2client.client import OAuth2Credentials [as 別名]
# 或者: from oauth2client.client.OAuth2Credentials import from_json [as 別名]
def locked_get(self):
serialized = session.get('google_oauth2_credentials')
if serialized is None:
return None
credentials = OAuth2Credentials.from_json(serialized)
credentials.set_store(self)
return credentials
示例3: locked_get
# 需要導入模塊: from oauth2client.client import OAuth2Credentials [as 別名]
# 或者: from oauth2client.client.OAuth2Credentials import from_json [as 別名]
def locked_get(self):
serialized = session.get(_CREDENTIALS_KEY)
if serialized is None:
return None
credentials = OAuth2Credentials.from_json(serialized)
credentials.set_store(self)
return credentials
示例4: pull_credentials
# 需要導入模塊: from oauth2client.client import OAuth2Credentials [as 別名]
# 或者: from oauth2client.client.OAuth2Credentials import from_json [as 別名]
def pull_credentials():
"""Pulls credentials out of session"""
return OAuth2Credentials.from_json(session['credentials'])