def __init__(self, version, path, isRelease): mhv = mhversion.MHVersion() self.version = version self.branch = mhv.currentBranch self.commit = mhv.currentShortCommit self.path = os.path.abspath(path) self.isRelease = isRelease self.datas = [] self.pathEx = [] self.rootSubpath = ""
def writeVersionFile(self): ### Write VERSION file versionFile = self.targetFile(VERSION_FILE_PATH) if not os.path.isdir(os.path.dirname( versionFile )): os.makedirs(os.path.dirname( versionFile )) mhv = mhversion.MHVersion() if not self.overrideVersion is None: mhv.version = self.overrideVersion if not self.overrideTitle is None: mhv.title = self.overrideTitle if not self.overrideGitBranch is None: mhv.currentBranch = self.overrideGitBranch if not self.overrideGitCommit is None: mhv.currentShortCommit = self.overrideGitcommit mhv.currentLongCommit = self.overrideGitcommit mhv.writeVersionFile(versionFile)