class ReadFileTest(unittest.TestCase): def setUp(self): self.read = Read() self.__path = "D:\Python\program\svnDeployWorkflow\conf\path.txt"; def testName(self): self.read.read(self.__path ,'svn_path')
class SvnInfo(object): def __init__(self): self.read = Read() self.workPath = '' #执行svn命令,将svn 信息放入info.txt文件夹 def svnCommand(self): filePath = os.path.abspath("../../conf") + "\path.txt" key = "svn_path"; self.workPath = self.read.read(filePath, key) os.chdir(self.workPath) command = "svn info > info.txt" os.system(command) def getSvnInfo(self): self.svnCommand() #info.txt文件的路径 infoPath = self.workPath + '/info.txt' key = '版本' svnInfo = self.read.read(infoPath, key); print svnInfo
def getWorkflowDirPath(self ,path_name_conf): read = Read() # filePath = os.path.abspath("../../conf") + "/path.txt" common = Common() filePath = common.getCommonPath(); dirPath = read.read(filePath, path_name_conf) return dirPath
def getPath(self): read = Read() common = Common() filePath = common.getCommonPath() self.target_path = read.read(filePath, "target_path") self.target_path = self.target_path + "\\" + self.workflowDirName + "\\"
def getWorkflowDirPath(self ,path_name_conf): read = Read() filePath = os.path.abspath("../../conf") + "/path.txt" dirPath = read.read(filePath, path_name_conf) return dirPath