本文整理汇总了Python中VistAMenuUtil.VistAMenuUtil.gotoFileManInquireFileEntryMenu方法的典型用法代码示例。如果您正苦于以下问题:Python VistAMenuUtil.gotoFileManInquireFileEntryMenu方法的具体用法?Python VistAMenuUtil.gotoFileManInquireFileEntryMenu怎么用?Python VistAMenuUtil.gotoFileManInquireFileEntryMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VistAMenuUtil.VistAMenuUtil
的用法示例。
在下文中一共展示了VistAMenuUtil.gotoFileManInquireFileEntryMenu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getInstallationStatus
# 需要导入模块: from VistAMenuUtil import VistAMenuUtil [as 别名]
# 或者: from VistAMenuUtil.VistAMenuUtil import gotoFileManInquireFileEntryMenu [as 别名]
def getInstallationStatus(self, installName):
connection = self._testClient.getConnection()
result = -1 # default is not installed
menuUtil = VistAMenuUtil(duz=1)
menuUtil.gotoFileManInquireFileEntryMenu(self._testClient)
connection.send("9.7\r") # Package file with fileman #9.7
connection.expect("Select INSTALL NAME:")
connection.send("%s\r" % installName)
while True:
index = connection.expect(["Select INSTALL NAME: ",
"ANOTHER ONE: ",
"CHOOSE 1-[0-9]+: "])
if index == 0:
connection.send("\r")
break
elif index == 1:
txtToSearch = connection.before.replace("\r\n","")
logger.debug(txtToSearch)
result = indexOfInstallStatus(txtToSearch)
connection.send("^\r")
break
# handle if the install has multiple install status
elif index == 2:
linesToSearch = connection.before.split("\r\n")
for line in linesToSearch: # only care the the first line
line = line.strip("\r\n ")
if not re.search("^1 ", line): continue
result = indexOfInstallStatus(line)
break
connection.send("^\r")
continue
menuUtil.exitFileManMenu(self._testClient)
return result