当前位置: 首页>>代码示例>>Python>>正文


Python StatusResourceBuild.stop方法代码示例

本文整理汇总了Python中buildbot.status.web.build.StatusResourceBuild.stop方法的典型用法代码示例。如果您正苦于以下问题:Python StatusResourceBuild.stop方法的具体用法?Python StatusResourceBuild.stop怎么用?Python StatusResourceBuild.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在buildbot.status.web.build.StatusResourceBuild的用法示例。


在下文中一共展示了StatusResourceBuild.stop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: performAction

# 需要导入模块: from buildbot.status.web.build import StatusResourceBuild [as 别名]
# 或者: from buildbot.status.web.build.StatusResourceBuild import stop [as 别名]
    def performAction(self, req):
        authz = self.getAuthz(req)
        res = yield authz.actionAllowed('stopAllBuilds', req)
        if not res:
            defer.returnValue(path_to_authzfail(req))
            return

        builders = None
        if self.selectedOrAll == 'all':
            builders = self.status.getBuilderNames()
        elif self.selectedOrAll == 'selected':
            builders = [b for b in req.args.get("selected", []) if b]

        for bname in builders:
            builder_status = self.status.getBuilder(bname)
            (state, current_builds) = builder_status.getState()
            if state != "building":
                continue
            for b in current_builds:
                build_status = builder_status.getBuild(b.number)
                if not build_status:
                    continue
                build = StatusResourceBuild(build_status)
                build.stop(req, auth_ok=True)

        # go back to the welcome page
        defer.returnValue(path_to_root(req))
开发者ID:AbhishekKumarSingh,项目名称:buildbot,代码行数:29,代码来源:builder.py

示例2: stopall

# 需要导入模块: from buildbot.status.web.build import StatusResourceBuild [as 别名]
# 或者: from buildbot.status.web.build.StatusResourceBuild import stop [as 别名]
    def stopall(self, req):
        authz = self.getAuthz(req)
        if not authz.actionAllowed("stopAllBuilds", req):
            return Redirect(path_to_authfail(req))

        for bname in self.status.getBuilderNames():
            builder_status = self.status.getBuilder(bname)
            (state, current_builds) = builder_status.getState()
            if state != "building":
                continue
            for b in current_builds:
                build_status = builder_status.getBuild(b.number)
                if not build_status:
                    continue
                build = StatusResourceBuild(build_status)
                build.stop(req, auth_ok=True)
        # go back to the welcome page
        return Redirect(path_to_root(req))
开发者ID:brasse,项目名称:buildbot,代码行数:20,代码来源:builder.py

示例3: stop

# 需要导入模块: from buildbot.status.web.build import StatusResourceBuild [as 别名]
# 或者: from buildbot.status.web.build.StatusResourceBuild import stop [as 别名]
 def stop(self, req):
     for bname in self.status.getBuilderNames():
         builder_status = self.status.getBuilder(bname)
         builder_control = None
         c = self.getControl(req)
         if c:
             builder_control = c.getBuilder(bname)
         (state, current_builds) = builder_status.getState()
         if state != "building":
             continue
         for b in current_builds:
             build_status = builder_status.getBuild(b.number)
             if not build_status:
                 continue
             if builder_control:
                 build_control = builder_control.getBuild(b.number)
             else:
                 build_control = None
             build = StatusResourceBuild(build_status, build_control,
                                         builder_control)
             build.stop(req)
     return Redirect("../../waterfall")
开发者ID:binoc-software,项目名称:mozilla-cvs,代码行数:24,代码来源:builder.py


注:本文中的buildbot.status.web.build.StatusResourceBuild.stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。