本文整理汇总了Python中coprs.logic.builds_logic.BuildsLogic.create_new_from_tito方法的典型用法代码示例。如果您正苦于以下问题:Python BuildsLogic.create_new_from_tito方法的具体用法?Python BuildsLogic.create_new_from_tito怎么用?Python BuildsLogic.create_new_from_tito使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coprs.logic.builds_logic.BuildsLogic
的用法示例。
在下文中一共展示了BuildsLogic.create_new_from_tito方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_new_build_tito
# 需要导入模块: from coprs.logic.builds_logic import BuildsLogic [as 别名]
# 或者: from coprs.logic.builds_logic.BuildsLogic import create_new_from_tito [as 别名]
def process_new_build_tito(copr, add_view, url_on_success):
form = forms.BuildFormTitoFactory(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_tito(
flask.g.user,
copr,
form.git_url.data,
form.git_directory.data,
form.git_branch.data,
form.tito_test.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_tito(copr, form, add_view)
示例2: factory
# 需要导入模块: from coprs.logic.builds_logic import BuildsLogic [as 别名]
# 或者: from coprs.logic.builds_logic.BuildsLogic import create_new_from_tito [as 别名]
def factory(**build_options):
BuildsLogic.create_new_from_tito(
flask.g.user,
copr,
form.git_url.data,
form.git_directory.data,
form.git_branch.data,
form.tito_test.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_tito [as 别名]
def create_new_build():
return BuildsLogic.create_new_from_tito(
flask.g.user,
copr,
form.git_url.data,
form.git_directory.data,
form.git_branch.data,
form.tito_test.data,
form.selected_chroots,
)