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


Python BuildRequest.subscribe方法代码示例

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


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

示例1: command_BUILD

# 需要导入模块: from buildbot.process.base import BuildRequest [as 别名]
# 或者: from buildbot.process.base.BuildRequest import subscribe [as 别名]
    def command_BUILD(self, args, who):
        args = shlex.split(args)
        repos = { 'apiextractor' : None,
                  'generatorrunner' : None,
                  'shiboken' : None,
                  'pyside' : None
                }

        if not who in config.gitCustomers:
            self.send('%s, I\'ll not make this build for you. Do you think I found my genitalia in the trash?' % who)
            return

        builder = None
        for arg in args:
            try:
                repo, target = arg.split('=')
            except:
                self.send('Usage: ' + PySideContact.command_BUILD.usage)
                return
            if repo == 'builder':
                builder = target
            else:
                if not repo in repos:
                    self.send('%s, there\'s no "%s" repository' % (who, repo))
                    return
                repos[repo] = target

        slaves = ['build-pyside-' + arch for arch in config.slavesByArch.keys()]

        if builder:
            if builder not in slaves:
                self.send("%s, the slave '%s' that you asked for doesn't exist." % (who, builder))
                return
            slaves = [builder]

        for which in slaves:
            bc = self.getControl(which)

            build_properties = Properties()
            build_properties.setProperty('owner', who, 'Build requested from IRC bot on behalf of %s.' % who)
            for propName, propValue in [(pName, pValue) for pName, pValue in repos.items() if pValue]:
                build_properties.setProperty(propName + '_hashtag', propValue, 'Build requested from IRC bot.')

            for repoName, gitUrl in config.gitCustomers[who].items():
                build_properties.setProperty(repoName.lower() + '_gitUrl', config.baseGitURL + gitUrl,
                                             'Personal %s repository of %s.' % (repoName, who))

            r = "forced: by %s: %s" % (self.describeUser(who), 'He had his reasons.')
            s = SourceStamp(branch='BRANCH', revision='REVISION')
            req = BuildRequest(r, s, which, properties=build_properties)
            try:
                bc.requestBuildSoon(req)
            except interfaces.NoSlaveError:
                self.send("%s, sorry, I can't force a build: all slaves are offline" % who)
                return
            ireq = IrcBuildRequest(self)
            req.subscribe(ireq.started)
开发者ID:PySide,项目名称:Buildbot,代码行数:59,代码来源:bordel.py

示例2: submitBuild

# 需要导入模块: from buildbot.process.base import BuildRequest [as 别名]
# 或者: from buildbot.process.base.BuildRequest import subscribe [as 别名]
 def submitBuild(self):
     ss = SourceStamp()
     br = BuildRequest("forced build", ss, "dummy")
     self.control.getBuilder("dummy").requestBuild(br)
     d = defer.Deferred()
     def _started(bc):
         br.unsubscribe(_started)
         d.callback(bc)
     br.subscribe(_started)
     return d
开发者ID:gescalante,项目名称:buildbot,代码行数:12,代码来源:test_run.py

示例3: send

# 需要导入模块: from buildbot.process.base import BuildRequest [as 别名]
# 或者: from buildbot.process.base.BuildRequest import subscribe [as 别名]
 def send(res):
     # send some build requests
     ss = SourceStamp()
     for i in range(5):
         req = BuildRequest(str(i), ss, "dummy")
         self.master.botmaster.builders['dummy'].submitBuildRequest(req)
         req.submittedAt = i
         def append(build):
             start_order.append(int(build.reason))
         req.subscribe(append)
         reqs.append(req.waitUntilFinished())
开发者ID:realalien,项目名称:buildbot.play,代码行数:13,代码来源:test_ordering.py

示例4: testPriority

# 需要导入模块: from buildbot.process.base import BuildRequest [as 别名]
# 或者: from buildbot.process.base.BuildRequest import subscribe [as 别名]
    def testPriority(self):
        self.rmtree("basedir")
        os.mkdir("basedir")
        self.master.loadConfig(config_priority)
        self.master.readConfig = True
        self.master.startService()

        # Our fake source stamp
        # we override canBeMergedWith so that our requests don't get merged together
        ss = SourceStamp()
        ss.canBeMergedWith = lambda x: False

        # Send 10 requests to alternating builders
        # We fudge the submittedAt field after submitting since they're all
        # getting submitted so close together according to time.time()
        # and all we care about is what order they're run in.
        reqs = []
        self.start_order = []
        for i in range(10):
            req = BuildRequest(str(i), ss, "test_builder")
            j = i % 2 + 1
            self.master.botmaster.builders['quick%i' % j].submitBuildRequest(req)
            req.submittedAt = i
            # Keep track of what order the builds start in
            def append(build):
                self.start_order.append(int(build.reason))
            req.subscribe(append)
            reqs.append(req.waitUntilFinished())

        dl = defer.DeferredList(reqs)
        dl.addCallback(self._all_finished)

        def _delay(res):
            d1 = defer.Deferred()
            reactor.callLater(0.5, d1.callback, None)
            # this test depends upon this 0.5s delay landing us in the middle
            # of one of the builds.
            return d1

        def _connect(res, i):
            return self.connectSlave(slavename="bot%i" % i, builders=["quick1", "quick2"])

        # Now add the slaves
        d = self.connectSlave(slavename="bot0", builders=["quick1", "quick2"])
        for i in range(1,5):
            d.addCallback(_delay)
            d.addCallback(_connect, i)

        d.addCallback(lambda x: dl)

        return d
开发者ID:LawrenceChan,项目名称:buildbot,代码行数:53,代码来源:test_run.py


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