本文整理汇总了Python中auth_systems.AUTH_SYSTEMS.keys方法的典型用法代码示例。如果您正苦于以下问题:Python AUTH_SYSTEMS.keys方法的具体用法?Python AUTH_SYSTEMS.keys怎么用?Python AUTH_SYSTEMS.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth_systems.AUTH_SYSTEMS
的用法示例。
在下文中一共展示了AUTH_SYSTEMS.keys方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: login_box_raw
# 需要导入模块: from auth_systems import AUTH_SYSTEMS [as 别名]
# 或者: from auth_systems.AUTH_SYSTEMS import keys [as 别名]
def login_box_raw(request, return_url="/", auth_systems=None):
"""
a chunk of HTML that shows the various login options
"""
default_auth_system_obj = None
if helios_auth.DEFAULT_AUTH_SYSTEM:
default_auth_system_obj = AUTH_SYSTEMS[helios_auth.DEFAULT_AUTH_SYSTEM]
# make sure that auth_systems includes only available and enabled auth systems
if auth_systems != None:
enabled_auth_systems = (
set(auth_systems).intersection(set(helios_auth.ENABLED_AUTH_SYSTEMS)).intersection(set(AUTH_SYSTEMS.keys()))
)
else:
enabled_auth_systems = set(auth.ENABLED_AUTH_SYSTEMS).intersection(set(AUTH_SYSTEMS.keys()))
form = password.LoginForm()
return render_template_raw(
request,
"login_box",
{
"enabled_auth_systems": enabled_auth_systems,
"return_url": return_url,
"default_auth_system": helios_auth.DEFAULT_AUTH_SYSTEM,
"default_auth_system_obj": default_auth_system_obj,
"form": form,
},
)
示例2: login_box_raw
# 需要导入模块: from auth_systems import AUTH_SYSTEMS [as 别名]
# 或者: from auth_systems.AUTH_SYSTEMS import keys [as 别名]
def login_box_raw(request, return_url='/', auth_systems = None):
"""
a chunk of HTML that shows the various login options
"""
default_auth_system_obj = None
if auth.DEFAULT_AUTH_SYSTEM:
default_auth_system_obj = AUTH_SYSTEMS[auth.DEFAULT_AUTH_SYSTEM]
# make sure that auth_systems includes only available and enabled auth systems
if auth_systems != None:
enabled_auth_systems = set(auth_systems).intersection(set(auth.ENABLED_AUTH_SYSTEMS)).intersection(set(AUTH_SYSTEMS.keys()))
else:
enabled_auth_systems = set(auth.ENABLED_AUTH_SYSTEMS).intersection(set(AUTH_SYSTEMS.keys()))
form = password.LoginForm()
return render_template_raw(request, 'login_box', {
'enabled_auth_systems': enabled_auth_systems, 'return_url': return_url,
'default_auth_system': auth.DEFAULT_AUTH_SYSTEM, 'default_auth_system_obj': default_auth_system_obj,
'form' : form})
示例3: login_box_raw
# 需要导入模块: from auth_systems import AUTH_SYSTEMS [as 别名]
# 或者: from auth_systems.AUTH_SYSTEMS import keys [as 别名]
def login_box_raw(request, return_url='/', auth_systems=None, remove_unload=False):
"""
a chunk of HTML that shows the various login options
"""
default_auth_system_obj = None
if helios_auth.DEFAULT_AUTH_SYSTEM:
default_auth_system_obj = AUTH_SYSTEMS[helios_auth.DEFAULT_AUTH_SYSTEM]
# make sure that auth_systems includes only available and enabled
# helios_auth systems
if auth_systems != None:
enabled_auth_systems = set(auth_systems).intersection(set(helios_auth.ENABLED_AUTH_SYSTEMS)).intersection(set(AUTH_SYSTEMS.keys()))
else:
enabled_auth_systems = set(helios_auth.ENABLED_AUTH_SYSTEMS).intersection(set(AUTH_SYSTEMS.keys()))
auth_systems = list()
for auth_system in enabled_auth_systems:
auth_systems.append({'name': auth_system, 'display_name': AUTH_SYSTEMS[auth_system].get_name()})
form = password.LoginForm()
return render_template_raw(request, 'login_box', {
'auth_systems': auth_systems,
'return_url': return_url,
'default_auth_system': helios_auth.DEFAULT_AUTH_SYSTEM,
'default_auth_system_obj': default_auth_system_obj,
'form': form,
'remove_unload': remove_unload
})