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
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 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 copyJar(self): key = "svn_path" svn_path = Read().getCommonValue(key) jars_key = "jars" jars = Read().getCommonValue(jars_key) jar_arr = jars.split(",") target_lib_path = self.target_path + "\lib\\" for jar in jar_arr: jar_path = svn_path + "\\" + jar + "\\target\\" + jar + ".jar" print "jar_path" + jar_path command = "xcopy " + jar_path + " " + target_lib_path os.system(command)
def setUp(self): self.read = Read() self.__path = "D:\Python\program\svnDeployWorkflow\conf\path.txt";
def getWorkflowDirPath(self ,path_name_conf): read = Read() filePath = os.path.abspath("../../conf") + "/path.txt" dirPath = read.read(filePath, path_name_conf) return dirPath
def __init__(self): self.read = Read() self.workPath = ''