当前位置: 首页>>代码示例>>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;未经允许,请勿转载。