当前位置: 首页>>代码示例>>Python>>正文


Python _helpers.scopes_to_string方法代码示例

本文整理汇总了Python中oauth2client._helpers.scopes_to_string方法的典型用法代码示例。如果您正苦于以下问题:Python _helpers.scopes_to_string方法的具体用法?Python _helpers.scopes_to_string怎么用?Python _helpers.scopes_to_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oauth2client._helpers的用法示例。


在下文中一共展示了_helpers.scopes_to_string方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from oauth2client import _helpers [as 别名]
# 或者: from oauth2client._helpers import scopes_to_string [as 别名]
def __init__(self, scope, **kwargs):
        """Constructor for AppAssertionCredentials

        Args:
            scope: string or iterable of strings, scope(s) of the credentials
                   being requested.
            **kwargs: optional keyword args, including:
            service_account_id: service account id of the application. If None
                                or unspecified, the default service account for
                                the app is used.
        """
        self.scope = _helpers.scopes_to_string(scope)
        self._kwargs = kwargs
        self.service_account_id = kwargs.get('service_account_id', None)
        self._service_account_email = None

        # Assertion type is no longer used, but still in the
        # parent class signature.
        super(AppAssertionCredentials, self).__init__(None) 
开发者ID:taers232c,项目名称:GAMADV-XTD,代码行数:21,代码来源:appengine.py

示例2: __init__

# 需要导入模块: from oauth2client import _helpers [as 别名]
# 或者: from oauth2client._helpers import scopes_to_string [as 别名]
def __init__(self,
                 service_account_email,
                 signer,
                 scopes='',
                 private_key_id=None,
                 client_id=None,
                 user_agent=None,
                 token_uri=oauth2client.GOOGLE_TOKEN_URI,
                 revoke_uri=oauth2client.GOOGLE_REVOKE_URI,
                 **kwargs):

        super(ServiceAccountCredentials, self).__init__(
            None, user_agent=user_agent, token_uri=token_uri,
            revoke_uri=revoke_uri)

        self._service_account_email = service_account_email
        self._signer = signer
        self._scopes = _helpers.scopes_to_string(scopes)
        self._private_key_id = private_key_id
        self.client_id = client_id
        self._user_agent = user_agent
        self._kwargs = kwargs 
开发者ID:taers232c,项目名称:GAMADV-XTD,代码行数:24,代码来源:service_account.py

示例3: test_iterables

# 需要导入模块: from oauth2client import _helpers [as 别名]
# 或者: from oauth2client._helpers import scopes_to_string [as 别名]
def test_iterables(self):
        cases = [
            ('', ''),
            ('', ()),
            ('', []),
            ('', ('',)),
            ('', ['', ]),
            ('a', ('a',)),
            ('b', ['b', ]),
            ('a b', ['a', 'b']),
            ('a b', ('a', 'b')),
            ('a b', 'a b'),
            ('a b', (s for s in ['a', 'b'])),
        ]
        for expected, case in cases:
            self.assertEqual(expected, _helpers.scopes_to_string(case)) 
开发者ID:openstack,项目名称:deb-python-oauth2client,代码行数:18,代码来源:test__helpers.py


注:本文中的oauth2client._helpers.scopes_to_string方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。