本文整理汇总了Python中coprs.logic.builds_logic.BuildsLogic.create_new_from_other_build方法的典型用法代码示例。如果您正苦于以下问题:Python BuildsLogic.create_new_from_other_build方法的具体用法?Python BuildsLogic.create_new_from_other_build怎么用?Python BuildsLogic.create_new_from_other_build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coprs.logic.builds_logic.BuildsLogic
的用法示例。
在下文中一共展示了BuildsLogic.create_new_from_other_build方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: factory
# 需要导入模块: from coprs.logic.builds_logic import BuildsLogic [as 别名]
# 或者: from coprs.logic.builds_logic.BuildsLogic import create_new_from_other_build [as 别名]
def factory(**build_options):
source_build = ComplexLogic.get_build_safe(build_id)
BuildsLogic.create_new_from_other_build(
flask.g.user, copr, source_build,
chroot_names=form.selected_chroots,
**build_options
)
示例2: process_rebuild
# 需要导入模块: from coprs.logic.builds_logic import BuildsLogic [as 别名]
# 或者: from coprs.logic.builds_logic.BuildsLogic import create_new_from_other_build [as 别名]
def process_rebuild(copr, build_id, view, url_on_success):
source_build = ComplexLogic.get_build_safe(build_id)
form = forms.BuildFormRebuildFactory.create_form_cls(copr.active_chroots)()
if form.validate_on_submit():
try:
build_options = {
"enable_net": form.enable_net.data,
"timeout": form.timeout.data,
}
BuildsLogic.create_new_from_other_build(
flask.g.user, copr, source_build,
chroot_names=form.selected_chroots,
**build_options
)
except (ActionInProgressException, InsufficientRightsException) as e:
flask.flash(str(e), "error")
db.session.rollback()
else:
flask.flash("New build has been created", "success")
db.session.commit()
return flask.redirect(url_on_success)
else:
return render_add_build(copr, form, view)