| 1234567891011121314151617181920212223242526272829303132 | # -*- coding:utf-8 -*-from ssat_sdk.sat_environment import getMenuTree3SelectedProjectCfgPathfrom UAT_log import debug,info,errorimport os, sys, timeDEBUG = TrueINFO = TrueERROR = Trueclass UATFileManage():    cls="UATFileManage"    def __init__(self):        self.UATreeDir = getMenuTree3SelectedProjectCfgPath()        info(self.cls, "__init__", "UATreeDir:" + str(self.UATreeDir), INFO)    def getUATreeList(self):        fileList = os.listdir(self.UATreeDir)        treeList = []        for filePath in fileList:            if filePath.lower().startswith("uatree") and (filePath.lower().endswith(".xls") or filePath.lower().endswith(".xlsx")):                treeList.append(os.path.join(self.UATreeDir, filePath))        return treeList    def getKeyCodeFile(self):        fileList = os.listdir(self.UATreeDir)        keyCodeFile = None        for filePath in fileList:            if filePath.lower() == "eventkey_code.xlsx":                keyCodeFile = os.path.join(self.UATreeDir, filePath)                break        return keyCodeFile
 |