本文整理汇总了Python中VistAMenuUtil.VistAMenuUtil.gotoFileManSearchFileEntryMenu方法的典型用法代码示例。如果您正苦于以下问题:Python VistAMenuUtil.gotoFileManSearchFileEntryMenu方法的具体用法?Python VistAMenuUtil.gotoFileManSearchFileEntryMenu怎么用?Python VistAMenuUtil.gotoFileManSearchFileEntryMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VistAMenuUtil.VistAMenuUtil
的用法示例。
在下文中一共展示了VistAMenuUtil.gotoFileManSearchFileEntryMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getAllPatchInstalledAfterByTime
# 需要导入模块: from VistAMenuUtil import VistAMenuUtil [as 别名]
# 或者: from VistAMenuUtil.VistAMenuUtil import gotoFileManSearchFileEntryMenu [as 别名]
def getAllPatchInstalledAfterByTime(self, dateTime):
""" This will search install file to find out all patches installed
after specific time
"""
connection = self._testClient.getConnection()
menuUtil = VistAMenuUtil(duz=1)
menuUtil.gotoFileManSearchFileEntryMenu(self._testClient)
connection.send("9.7\r") # INSTALL file #
connection.expect("-A- SEARCH FOR INSTALL FIELD: ")
connection.send("17\r") # field # for INSTALL COMPLETE TIME
connection.expect("-A- CONDITION: ")
connection.send("GREATER THAN\r")
connection.expect("-A- GREATER THAN DATE: ")
connection.send("%s\r" % dateTime)
connection.expect("-B- SEARCH FOR INSTALL FIELD: ")
connection.send("\r")
connection.expect("IF: A// ")
connection.send("\r")
connection.expect("STORE RESULTS OF SEARCH IN TEMPLATE: ")
connection.send("\r")
connection.expect([re.compile("SORT BY: ", re.I),
re.compile("SORT BY: NAME// ", re.I)])
connection.send("17\r") # sort by INSTALL COMPLETE TIME
connection.expect([re.compile("START WITH INSTALL COMPLETE TIME: ", re.I),
re.compile("START WITH INSTALL COMPLETE TIME: FIRST// ",re.I)])
connection.send("\r")
connection.expect(re.compile("WITHIN INSTALL COMPLETE TIME, SORT BY: ", re.I))
connection.send("\r")
connection.expect(re.compile("FIRST PRINT FIELD: ", re.I))
connection.send("NAME\r")
connection.expect(re.compile("THEN PRINT FIELD: ", re.I))
connection.send("17\r")
connection.expect(re.compile("THEN PRINT FIELD: ", re.I))
connection.send("\r")
connection.expect(re.compile("Heading \(S/C\): INSTALL SEARCH// ", re.I))
connection.send("\r") # use default heading
connection.expect("DEVICE:")
connection.send(";132;99999\r")
connection.expect("[0-9]+ MATCH(ES)? FOUND\.")
result = connection.before.split("\r\n")
output = []
resultStart = False
DATETIME_INDENT = 52
for line in result:
line = line.strip()
if len(line) == 0:
continue
if resultStart:
output.append((line[:DATETIME_INDENT].rstrip(),
parsePatchInstallDatetime(line[DATETIME_INDENT:])))
continue
if re.search('^-+$',line):
resultStart = True
menuUtil.exitFileManMenu(self._testClient)
return output
示例2: getInstallationStatus
# 需要导入模块: from VistAMenuUtil import VistAMenuUtil [as 别名]
# 或者: from VistAMenuUtil.VistAMenuUtil import gotoFileManSearchFileEntryMenu [as 别名]
def getInstallationStatus(self, installName):
connection = self._testClient.getConnection()
result = -1 # default is not installed
if not self.isPatchInstalled(installName):
menuUtil = VistAMenuUtil(duz=1)
menuUtil.gotoFileManSearchFileEntryMenu(self._testClient)
connection.send("9.7\r") # Package file with fileman #9.7
connection.expect("SEARCH FOR")
connection.send("NAME\r")
connection.expect("CONDITION:")
connection.send("EQUALS\r")
connection.expect("EQUALS")
connection.send("%s\r" % installName)
connection.expect("SEARCH FOR")
connection.send("\r")
connection.expect("IF:")
connection.send("\r")
connection.expect("IN TEMPLATE")
connection.send("\r")
connection.expect(re.compile("SORT BY: ", re.I))
connection.send("\r")
connection.expect("Start with")
connection.send("\r")
connection.expect("First Print")
connection.send("STATUS\r")
connection.expect("Then Print")
connection.send("\r")
connection.expect("Heading")
connection.send("\r")
connection.expect("DEVICE:")
connection.send(";132;99999\r")
connection.expect("Select OPTION: ")
linesToSearch = connection.before.split("\r\n")
for line in linesToSearch: # only care the the first line
line = line.strip("\r\n ")
tmpResult = indexOfInstallStatus(line)
if tmpResult > result:
result=tmpResult
connection.send("?\r")
menuUtil.exitFileManMenu(self._testClient)
return result
else:
return 3