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


Python ProcessHandler.processOutput方法代码示例

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


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

示例1: perform_build

# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import processOutput [as 别名]
    def perform_build(self, history_line):
        import pdb
        pdb.set_trace()
        self.build_number += 1
        self.start_time = datetime.now()
        log.debug("Performing build %d on history line: %s" % (self.build_number, history_line))
        build_proc = ProcessHandler(cmd = ['/home/ctalbert/projects/b2g-hamachi/build.sh'],
                                    cwd = self.build_info['workdir'],
                                    env=self.build_info['env'],
                                    processOutputLine=[self.notify_status],
                                    kill_on_timeout=True,
                                    onTimeout=[self.notify_timeout],
                                    onFinish=[self.notify_finished],
                                    shell=True)

        try:
            sys.stdout.write("Starting Build %d:" % self.build_number)
            build_proc.run(timeout=7200)
            build_proc.processOutput()
            exitcode = build_proc.wait()
        except (KeyboardInterrupt, SystemExit):
            print "User Canceled Operation!"
            log.debug("Build canceled by user")
            raise
        finally:
            self.build_log.close()

        if exitcode == 0:
            print "Build %d Completed Successfully" % self.build_number
            log.debug("Build %d for history line: %s completed successfully" % (self.build_number, history_line))
        else:
            print "Build %d Failed" % self.build_number
            log.debug("Build %d for history line: %s FAILED" % (self.build_number, history_line))
开发者ID:ctalbert,项目名称:bisect_b2g,代码行数:35,代码来源:evaluator.py

示例2: execute_cmd

# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import processOutput [as 别名]
def execute_cmd(cmd, cwd):
    print 'executing', cmd
    proc = ProcessHandler(cmd, cwd=cwd)
    proc.processOutput(timeout=180)
    assert(proc.waitForFinish() == 0)
开发者ID:jonallengriffin,项目名称:b2gautomation,代码行数:7,代码来源:make_device_manifests.py


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