本文整理汇总了Python中mozprocess.ProcessHandler.returncode方法的典型用法代码示例。如果您正苦于以下问题:Python ProcessHandler.returncode方法的具体用法?Python ProcessHandler.returncode怎么用?Python ProcessHandler.returncode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozprocess.ProcessHandler
的用法示例。
在下文中一共展示了ProcessHandler.returncode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _runCmd
# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import returncode [as 别名]
def _runCmd(self, args, timeout=None, retryLimit=None):
"""
Runs a command using adb
If timeout is specified, the process is killed after <timeout> seconds.
returns: instance of ProcessHandler
"""
retryLimit = retryLimit or self.retryLimit
finalArgs = [self._adbPath]
if self._serverHost is not None:
finalArgs.extend(['-H', self._serverHost])
if self._serverPort is not None:
finalArgs.extend(['-P', str(self._serverPort)])
if self._deviceSerial:
finalArgs.extend(['-s', self._deviceSerial])
finalArgs.extend(args)
self._logger.debug("_runCmd - command: %s" % ' '.join(finalArgs))
if not timeout:
timeout = self.default_timeout
def _timeout():
self._logger.error("Timeout exceeded for _runCmd call '%s'" % ' '.join(finalArgs))
retries = 0
while retries < retryLimit:
proc = ProcessHandler(finalArgs, storeOutput=True,
processOutputLine=self._log, onTimeout=_timeout)
proc.run(timeout=timeout)
proc.returncode = proc.wait()
if proc.returncode == None:
proc.kill()
retries += 1
else:
return proc
示例2: _runCmd
# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import returncode [as 别名]
def _runCmd(self, args, retryLimit=None):
"""
Runs a command using adb
returns: instance of ProcessHandler
"""
retryLimit = retryLimit or self.retryLimit
finalArgs = [self._adbPath]
if self._serverHost is not None:
finalArgs.extend(['-H', self._serverHost])
if self._serverPort is not None:
finalArgs.extend(['-P', str(self._serverPort)])
if self._deviceSerial:
finalArgs.extend(['-s', self._deviceSerial])
finalArgs.extend(args)
self._logger.debug("_runCmd - command: %s" % ' '.join(finalArgs))
retries = 0
while retries < retryLimit:
proc = ProcessHandler(finalArgs, storeOutput=True,
processOutputLine=self._log)
proc.run()
proc.returncode = proc.wait()
if proc.returncode == None:
proc.kill()
retries += 1
else:
return proc
示例3: _runCmd
# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import returncode [as 别名]
def _runCmd(self, args):
"""
Runs a command using adb
returns: instance of ProcessHandler
"""
finalArgs = [self._adbPath]
if self._deviceSerial:
finalArgs.extend(['-s', self._deviceSerial])
finalArgs.extend(args)
self._logger.debug("_runCmd - command: %s" % ' '.join(finalArgs))
proc = ProcessHandler(finalArgs, storeOutput=True,
processOutputLine=self._log)
proc.run()
proc.returncode = proc.wait()
return proc