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


Python ProviderSettings.update方法代码示例

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


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

示例1: add_live_login_from_settings

# 需要导入模块: from velruse.settings import ProviderSettings [as 别名]
# 或者: from velruse.settings.ProviderSettings import update [as 别名]
def add_live_login_from_settings(config, prefix='velruse.live.'):
    settings = config.registry.settings
    p = ProviderSettings(settings, prefix)
    p.update('consumer_key', required=True)
    p.update('consumer_secret', required=True)
    p.update('scope')
    p.update('login_path')
    p.update('callback_path')
    config.add_live_login(**p.kwargs)
开发者ID:mmariani,项目名称:velruse,代码行数:11,代码来源:live.py

示例2: add_google_oauth2_login_from_settings

# 需要导入模块: from velruse.settings import ProviderSettings [as 别名]
# 或者: from velruse.settings.ProviderSettings import update [as 别名]
def add_google_oauth2_login_from_settings(config, prefix='velruse.google.'):
    settings = config.registry.settings
    p = ProviderSettings(settings, prefix)
    if settings.get(prefix + 'protocol') == 'oauth2':
        p.update('consumer_key', required=True)
        p.update('consumer_secret', required=True)
        p.update('scope')
        p.update('login_path')
        p.update('callback_path')
        config.add_google_login(protocol='oauth2', **p.kwargs)
开发者ID:naktinis,项目名称:velruse,代码行数:12,代码来源:__init__.py

示例3: add_google_login_from_settings

# 需要导入模块: from velruse.settings import ProviderSettings [as 别名]
# 或者: from velruse.settings.ProviderSettings import update [as 别名]
def add_google_login_from_settings(config, prefix='velruse.google.'):
    settings = config.registry.settings
    protocol = settings.get(prefix + 'protocol', 'hybrid')
    if protocol == 'oauth2':
        p = ProviderSettings(settings, prefix)
        p.update('consumer_key', required=True)
        p.update('consumer_secret', required=True)
        p.update('scope')
        p.update('login_path')
        p.update('callback_path')
        config.add_google_login(protocol='oauth2', **p.kwargs)
    else:
        raise ValueError('cannot automatically load google provider from '
                         'settings, unsupported protocol')
开发者ID:glim,项目名称:velruse,代码行数:16,代码来源:__init__.py

示例4: add_twitter_login_from_settings

# 需要导入模块: from velruse.settings import ProviderSettings [as 别名]
# 或者: from velruse.settings.ProviderSettings import update [as 别名]
def add_twitter_login_from_settings(config, prefix="velruse.twitter."):
    settings = config.registry.settings
    p = ProviderSettings(settings, prefix)
    p.update("consumer_key", required=True)
    p.update("consumer_secret", required=True)
    p.update("login_path")
    p.update("callback_path")
    config.add_twitter_login(**p.kwargs)
开发者ID:naktinis,项目名称:velruse,代码行数:10,代码来源:twitter.py

示例5: add_openid_from_settings

# 需要导入模块: from velruse.settings import ProviderSettings [as 别名]
# 或者: from velruse.settings.ProviderSettings import update [as 别名]
def add_openid_from_settings(config, prefix='velruse.openid.'):
    from velruse.settings import ProviderSettings
    settings = config.registry.settings
    p = ProviderSettings(settings, prefix)
    p.update('realm')
    p.update('storage')
    p.update('login_path')
    p.update('callback_path')
    config.add_openid_login(**p.kwargs)
开发者ID:VoteIT,项目名称:voteit.velruse,代码行数:11,代码来源:openid.py

示例6: add_yasso_login_from_settings

# 需要导入模块: from velruse.settings import ProviderSettings [as 别名]
# 或者: from velruse.settings.ProviderSettings import update [as 别名]
def add_yasso_login_from_settings(config, prefix):
    settings = config.registry.settings
    p = ProviderSettings(settings, prefix)
    p.update('authorize_url', required=True)
    p.update('token_url', required=True)
    p.update('userinfo_url', required=True)
    p.update('client_id', required=True)
    p.update('client_secret', required=True)
    p.update('login_path')
    p.update('callback_path')
    p.update('name')
    config.add_yasso_login(**p.kwargs)
开发者ID:araymund,项目名称:karl,代码行数:14,代码来源:sso_yasso.py


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