當前位置: 首頁>>代碼示例>>Python>>正文


Python util.dict_to_tuple_key方法代碼示例

本文整理匯總了Python中oauth2client.util.dict_to_tuple_key方法的典型用法代碼示例。如果您正苦於以下問題:Python util.dict_to_tuple_key方法的具體用法?Python util.dict_to_tuple_key怎麽用?Python util.dict_to_tuple_key使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在oauth2client.util的用法示例。


在下文中一共展示了util.dict_to_tuple_key方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_credential_storage_custom_key

# 需要導入模塊: from oauth2client import util [as 別名]
# 或者: from oauth2client.util import dict_to_tuple_key [as 別名]
def get_credential_storage_custom_key(
    filename, key_dict, warn_on_readonly=True):
  """Get a Storage instance for a credential using a dictionary as a key.

  Allows you to provide a dictionary as a custom key that will be used for
  credential storage and retrieval.

  Args:
    filename: The JSON file storing a set of credentials
    key_dict: A dictionary to use as the key for storing this credential. There
      is no ordering of the keys in the dictionary. Logically equivalent
      dictionaries will produce equivalent storage keys.
    warn_on_readonly: if True, log a warning if the store is readonly

  Returns:
    An object derived from client.Storage for getting/setting the
    credential.
  """
  multistore = _get_multistore(filename, warn_on_readonly=warn_on_readonly)
  key = util.dict_to_tuple_key(key_dict)
  return multistore._get_storage(key) 
開發者ID:mortcanty,項目名稱:earthengine,代碼行數:23,代碼來源:multistore_file.py

示例2: get_credential_storage_custom_key

# 需要導入模塊: from oauth2client import util [as 別名]
# 或者: from oauth2client.util import dict_to_tuple_key [as 別名]
def get_credential_storage_custom_key(filename, key_dict,
                                      warn_on_readonly=True):
    """Get a Storage instance for a credential using a dictionary as a key.

    Allows you to provide a dictionary as a custom key that will be used for
    credential storage and retrieval.

    Args:
        filename: The JSON file storing a set of credentials
        key_dict: A dictionary to use as the key for storing this credential.
                  There is no ordering of the keys in the dictionary. Logically
                  equivalent dictionaries will produce equivalent storage keys.
        warn_on_readonly: if True, log a warning if the store is readonly

    Returns:
        An object derived from client.Storage for getting/setting the
        credential.
    """
    multistore = _get_multistore(filename, warn_on_readonly=warn_on_readonly)
    key = util.dict_to_tuple_key(key_dict)
    return multistore._get_storage(key) 
開發者ID:luci,項目名稱:luci-py,代碼行數:23,代碼來源:multistore_file.py

示例3: _decode_credential_from_json

# 需要導入模塊: from oauth2client import util [as 別名]
# 或者: from oauth2client.util import dict_to_tuple_key [as 別名]
def _decode_credential_from_json(self, cred_entry):
        """Load a credential from our JSON serialization.

        Args:
            cred_entry: A dict entry from the data member of our format

        Returns:
            (key, cred) where the key is the key tuple and the cred is the
            OAuth2Credential object.
        """
        raw_key = cred_entry['key']
        key = util.dict_to_tuple_key(raw_key)
        credential = None
        credential = Credentials.new_from_json(
            json.dumps(cred_entry['credential']))
        return (key, credential) 
開發者ID:luci,項目名稱:luci-py,代碼行數:18,代碼來源:multistore_file.py

示例4: _decode_credential_from_json

# 需要導入模塊: from oauth2client import util [as 別名]
# 或者: from oauth2client.util import dict_to_tuple_key [as 別名]
def _decode_credential_from_json(self, cred_entry):
    """Load a credential from our JSON serialization.

    Args:
      cred_entry: A dict entry from the data member of our format

    Returns:
      (key, cred) where the key is the key tuple and the cred is the
        OAuth2Credential object.
    """
    raw_key = cred_entry['key']
    key = util.dict_to_tuple_key(raw_key)
    credential = None
    credential = Credentials.new_from_json(json.dumps(cred_entry['credential']))
    return (key, credential) 
開發者ID:mortcanty,項目名稱:earthengine,代碼行數:17,代碼來源:multistore_file.py

示例5: _decode_credential_from_json

# 需要導入模塊: from oauth2client import util [as 別名]
# 或者: from oauth2client.util import dict_to_tuple_key [as 別名]
def _decode_credential_from_json(self, cred_entry):
    """Load a credential from our JSON serialization.

    Args:
      cred_entry: A dict entry from the data member of our format

    Returns:
      (key, cred) where the key is the key tuple and the cred is the
        OAuth2Credential object.
    """
    raw_key = cred_entry['key']
    key = util.dict_to_tuple_key(raw_key)
    credential = None
    credential = Credentials.new_from_json(simplejson.dumps(cred_entry['credential']))
    return (key, credential) 
開發者ID:splunk,項目名稱:splunk-ref-pas-code,代碼行數:17,代碼來源:multistore_file.py


注:本文中的oauth2client.util.dict_to_tuple_key方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。