本文整理汇总了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)
示例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)
示例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')
示例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)
示例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)
示例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)