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