示例#1
0
def render_add_build_rubygems(copr, form, view, package=None):
    if not form:
        form = forms.BuildFormRubyGemsFactory(copr.active_chroots)()
    return flask.render_template("coprs/detail/add_build/rubygems.html",
                                 copr=copr,
                                 form=form,
                                 view=view,
                                 package=package)
示例#2
0
def process_new_build_rubygems(copr, add_view, url_on_success):
    def factory(**build_options):
        BuildsLogic.create_new_from_rubygems(flask.g.user, copr,
                                             form.gem_name.data,
                                             form.selected_chroots,
                                             **build_options)

    form = forms.BuildFormRubyGemsFactory(copr.active_chroots)()
    return process_new_build(copr, form, factory, render_add_build_rubygems,
                             add_view, url_on_success)
示例#3
0
def copr_new_build_rubygems(copr):
    form = forms.BuildFormRubyGemsFactory(
        copr.active_chroots)(csrf_enabled=False)

    def create_new_build():
        return BuildsLogic.create_new_from_rubygems(
            flask.g.user,
            copr,
            form.gem_name.data,
            form.selected_chroots,
        )

    return process_creating_new_build(copr, form, create_new_build)
示例#4
0
def copr_new_build_rubygems(copr):
    form = forms.BuildFormRubyGemsFactory(copr.active_chroots)(meta={
        'csrf': False
    })

    def create_new_build():
        return BuildsLogic.create_new_from_rubygems(
            flask.g.user,
            copr,
            form.gem_name.data,
            form.selected_chroots,
            background=form.background.data,
        )

    return process_creating_new_build(copr, form, create_new_build)
示例#5
0
def create_from_rubygems():
    copr = get_copr()
    data = get_form_compatible_data()
    form = forms.BuildFormRubyGemsFactory(copr.active_chroots)(data, meta={'csrf': False})

    def create_new_build():
        return BuildsLogic.create_new_from_rubygems(
            flask.g.user,
            copr,
            form.gem_name.data,
            form.selected_chroots,
            background=form.background.data,
            copr_dirname=form.project_dirname.data,
        )
    return process_creating_new_build(copr, form, create_new_build)