本文整理汇总了Python中isp.nsmUtil.NsmUtil.printStatusHeadLine方法的典型用法代码示例。如果您正苦于以下问题:Python NsmUtil.printStatusHeadLine方法的具体用法?Python NsmUtil.printStatusHeadLine怎么用?Python NsmUtil.printStatusHeadLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类isp.nsmUtil.NsmUtil
的用法示例。
在下文中一共展示了NsmUtil.printStatusHeadLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: processCmdList
# 需要导入模块: from isp.nsmUtil import NsmUtil [as 别名]
# 或者: from isp.nsmUtil.NsmUtil import printStatusHeadLine [as 别名]
def processCmdList(self, cmdList):
status = True
for oneCmdSet in cmdList:
cmdStr = oneCmdSet['cmd']
expectPattern = oneCmdSet['expect'] if 'expect' in oneCmdSet.keys() else None
sleep = oneCmdSet['sleep'] if 'sleep' in oneCmdSet.keys() else None
self._expect.sendIt(cmdStr)
'''
if sleep:
self._logger.info('sleep: ' + sleep + ' seconds ...')
time.sleep(int(sleep))
'''
if sleep:
self._expect.setDefaultTimeout(int(sleep)*1000)
self._logger.info('timeout is set to ' + sleep + ' seconds')
if expectPattern:
self._expect.expectIt(expectPattern)
self._output = self._expect._output
if re.search(expectPattern, self._output):
NsmUtil.printStatusHeadLine('Passed: pattern found: ' + expectPattern)
else:
NsmUtil.printStatusHeadLine('Failed: pattern not found: ' + expectPattern)
status = False
else:
self._expect.expectAll()
if sleep: self._expect.setDefaultTimeout(30*1000)
return status