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


Python ComplexLogic.get_copr_safe方法代码示例

本文整理汇总了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)
开发者ID:ignatenkobrain,项目名称:copr,代码行数:10,代码来源:api_general.py

示例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)
开发者ID:danvratil,项目名称:copr,代码行数:11,代码来源:misc.py

示例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)
开发者ID:ignatenkobrain,项目名称:copr,代码行数:17,代码来源:coprs_general.py


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