本文整理汇总了Python中coprs.logic.complex_logic.ComplexLogic.get_copr_safe方法的典型用法代码示例。如果您正苦于以下问题:Python ComplexLogic.get_copr_safe方法的具体用法?Python ComplexLogic.get_copr_safe怎么用?Python ComplexLogic.get_copr_safe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coprs.logic.complex_logic.ComplexLogic
的用法示例。
在下文中一共展示了ComplexLogic.get_copr_safe方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: wrapper
# 需要导入模块: from coprs.logic.complex_logic import ComplexLogic [as 别名]
# 或者: from coprs.logic.complex_logic.ComplexLogic import get_copr_safe [as 别名]
def wrapper(username, coprname, **kwargs):
if username.startswith("@"):
group_name = username[1:]
copr = ComplexLogic.get_group_copr_safe(group_name, coprname)
else:
copr = ComplexLogic.get_copr_safe(username, coprname)
return f(copr, **kwargs)
示例2: wrapper
# 需要导入模块: from coprs.logic.complex_logic import ComplexLogic [as 别名]
# 或者: from coprs.logic.complex_logic.ComplexLogic import get_copr_safe [as 别名]
def wrapper(**kwargs):
coprname = kwargs.pop("coprname")
if "group_name" in kwargs:
group_name = kwargs.pop("group_name")
copr = ComplexLogic.get_group_copr_safe(group_name, coprname, with_mock_chroots=True)
else:
username = kwargs.pop("username")
copr = ComplexLogic.get_copr_safe(username, coprname, with_mock_chroots=True)
return f(copr, **kwargs)
示例3: generate_repo_file
# 需要导入模块: from coprs.logic.complex_logic import ComplexLogic [as 别名]
# 或者: from coprs.logic.complex_logic.ComplexLogic import get_copr_safe [as 别名]
def generate_repo_file(username, coprname, name_release, repofile):
""" Generate repo file for a given repo name.
Reponame = username-coprname """
# This solution is used because flask splits off the last part after a
# dash, therefore user-re-po resolves to user-re/po instead of user/re-po
# FAS usernames may not contain dashes, so this construction is safe.
# support access to the group projects using @-notation
# todo: remove when yum/dnf plugin is updated to use new url schema
if username.startswith("@"):
return group_generate_repo_file(group_name=username[1:], coprname=coprname,
name_release=name_release, repofile=repofile)
copr = ComplexLogic.get_copr_safe(username, coprname)
return render_generate_repo_file(copr, name_release)