本文整理汇总了Python中VistAMenuUtil.VistAMenuUtil.exitKidsUtilMenu方法的典型用法代码示例。如果您正苦于以下问题:Python VistAMenuUtil.exitKidsUtilMenu方法的具体用法?Python VistAMenuUtil.exitKidsUtilMenu怎么用?Python VistAMenuUtil.exitKidsUtilMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VistAMenuUtil.VistAMenuUtil
的用法示例。
在下文中一共展示了VistAMenuUtil.exitKidsUtilMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getPackagePatchHistory
# 需要导入模块: from VistAMenuUtil import VistAMenuUtil [as 别名]
# 或者: from VistAMenuUtil.VistAMenuUtil import exitKidsUtilMenu [as 别名]
def getPackagePatchHistory(self, packageName, namespace):
if not self._packageMapping:
self.createAllPackageMapping()
connection = self._testClient.getConnection()
result = None
menuUtil = VistAMenuUtil(duz=1) # set duz as 1
menuUtil.gotoKidsUtilMenu(self._testClient)
connection.send("Display\r")
connection.expect("Select PACKAGE NAME:")
connection.send("%s\r" % packageName)
while True:
index = connection.expect(["Select VERSION: [0-9.]+\/\/",
"Select VERSION: ",
"Select Utilities ",
"CHOOSE [0-9]+-[0-9]+"])
if index == 3:
outchoice = findChoiceNumber(connection.before, packageName, namespace)
if outchoice:
connection.send("%s\r" % outchoice)
else: # no match
connection.send("\r")
continue
if index == 0 or index == 1:
if index == 0:
connection.send("\r")
else:
connection.send("1.0\r")
connection.expect("Do you want to see the Descriptions\?")
connection.send("\r")
connection.expect("DEVICE:")
connection.send(";132;99999\r")
connection.expect("Select Utilities ")
result = parseKIDSPatchHistory(connection.before,
packageName, namespace)
break
else:
break
menuUtil.exitKidsUtilMenu(self._testClient)
self._packagePatchHist[packageName] = result
return result
示例2: getPackagePatchHistory
# 需要导入模块: from VistAMenuUtil import VistAMenuUtil [as 别名]
# 或者: from VistAMenuUtil.VistAMenuUtil import exitKidsUtilMenu [as 别名]
def getPackagePatchHistory(self, packageName, namespace, version=None):
if not self._packageMapping:
self.createAllPackageMapping()
connection = self._testClient.getConnection()
result = None
menuUtil = VistAMenuUtil(duz=1) # set duz as 1
menuUtil.gotoKidsUtilMenu(self._testClient)
connection.send("Display\r")
connection.expect("Select PACKAGE NAME:")
connection.send("%s\r" % packageName)
while True:
index = connection.expect(["Select VERSION: [0-9.VvTtPp]+\/\/",
"Select VERSION: ",
"Select Utilities ",
"CHOOSE [0-9]+-[0-9]+"])
if index == 3:
outchoice = findChoiceNumber(connection.before, packageName, namespace)
if outchoice:
connection.send("%s\r" % outchoice)
else: # no match
connection.send("\r")
continue
if index == 0 or index == 1:
if index == 0:
if version:
connection.send("%s\r" % version)
else:
connection.send("\r")
else:
connection.send("1.0\r")
""" handle the case that same version could also have different
history, like test version T1, T2 or V1, V2, or package does not
have a version information (old system)
"""
while True:
idx = connection.expect(["Do you want to see the Descriptions\?",
"CHOOSE [0-9]+-[0-9]+",
"Select VERSION: ",
"DEVICE:"])
if idx == 0:
connection.send("\r")
continue
elif idx == 1:
connection.send("1\r") # always use the latest one
continue
elif idx == 2:
connection.send('^\r')
break
elif idx ==3 :
connection.send(";132;99999\r")
break
connection.expect("Select Utilities ")
result = parsePackagePatchHistory(connection.before,
packageName, namespace, version)
break
else:
break
menuUtil.exitKidsUtilMenu(self._testClient)
if not result:
return result
assert result.version
# ignore the non-floating version
try:
curVer = float(result.version)
except ValueError as ve:
return None
if packageName not in self._packagePatchHist:
self._packagePatchHist[packageName] = dict()
verDict = self._packagePatchHist[packageName]
curVer = float(result.version)
if curVer in verDict:
logger.info("already has hist for ver:%s, package:%s" %
(result.version, packageName))
self._packagePatchHist[packageName][curVer] = result
return result