コード例 #1
0
    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
0
ファイル: api_general.py プロジェクト: ignatenkobrain/copr
    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)
コード例 #3
0
ファイル: misc.py プロジェクト: danvratil/copr
 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)
コード例 #4
0
 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)
コード例 #5
0
ファイル: coprs_general.py プロジェクト: ignatenkobrain/copr
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)
コード例 #6
0
ファイル: coprs_general.py プロジェクト: tedwardia/copr
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)