ba6b31f2a96fc3720971e888928de9d28d40b60d wong Fri Oct 28 14:45:43 2011 -0700 declared some attributes earlier to bypass a qa check. diff --git python/lib/ucscgenomics/mkChangeNotes.py python/lib/ucscgenomics/mkChangeNotes.py index 8a9a3ba..5109596 100644 --- python/lib/ucscgenomics/mkChangeNotes.py +++ python/lib/ucscgenomics/mkChangeNotes.py @@ -333,71 +333,63 @@ output.extend(ucscUtils.printIter(missing, path)) output.append("\n") return output def __checkAtticNotInTrackDb(self): errors = [] atticTables = self.newMdb.filter(lambda s: s['objType'] == 'table' and 'attic' in s, lambda s: s['tableName']) for i in atticTables: foo = self.trackDb.filter(lambda s: i in s['track'], lambda s: s['track']) if foo: errors.append("trackDb: %s is attic in metaDb, has an active trackDb entry" % i) return errors def printReport(self, args, c): - (totalFiles, newGbdbSet, newTableSet, additionalList, oldAdditionalList, oldTableSet, oldReleaseFiles, oldGbdbSet, atticSet, revokedFiles, revokedTableSet, revokedGbdbs, missingFiles, newSupplementalSet, oldSupplementalSet) = (self.totalFiles, self.newGbdbSet, self.newTableSet, self.additionalList, self.oldAdditionalList, self.oldTableSet, self.oldTotalFiles, self.oldGbdbSet, self.atticSet, self.revokedFiles, self.revokedTableSet, self.revokedGbdbs, self.missingFiles, self.newSupplementalSet, self.oldSupplementalSet) + (totalFiles, newGbdbSet, newTableSet, additionalList, oldAdditionalList, oldTableSet, oldReleaseFiles, oldGbdbSet, atticSet, revokedFiles, revokedTableSet, revokedGbdbs, missingFiles, newSupplementalSet, oldSupplementalSet, pushTables, pushFiles, pushGbdbs, newSupp) = (self.totalFiles, self.newGbdbSet, self.newTableSet, self.additionalList, self.oldAdditionalList, self.oldTableSet, self.oldTotalFiles, self.oldGbdbSet, self.atticSet, self.revokedFiles, self.revokedTableSet, self.revokedGbdbs, self.missingFiles, self.newSupplementalSet, self.oldSupplementalSet, self.pushTables, self.pushFiles, self.pushGbdbs, self.newSupp) #the groups here need to be predefined, I just copied and pasted after working out what they were sep = "\n" output = [] #maths allTables = newTableSet | oldTableSet | revokedTableSet - pushTables = set(sorted((self.newTableSet - self.oldTableSet))) untouchedTables = oldTableSet & newTableSet allFiles = totalFiles | oldReleaseFiles | revokedFiles - pushFiles = set(sorted((self.totalFiles - self.oldTotalFiles))) newFiles = pushFiles - revokedFiles untouchedFiles = (totalFiles & oldReleaseFiles) - revokedFiles filesNoRevoke = totalFiles - revokedFiles allGbdbs = newGbdbSet | oldGbdbSet | revokedGbdbs untouchedGbdbs = (newGbdbSet & oldGbdbSet) - revokedGbdbs - pushGbdbs = set(sorted((self.newGbdbSet - self.oldGbdbSet))) allSupp = newSupplementalSet | oldSupplementalSet - newSupp = newSupplementalSet - oldSupplementalSet removedSupp = oldSupplementalSet - newSupplementalSet untouchedSupp = oldSupplementalSet & newSupplementalSet allOther = additionalList | oldAdditionalList removedOther = oldAdditionalList - additionalList output.extend(self.__qaHeader(output, newTableSet, filesNoRevoke, newGbdbSet, newSupp, additionalList, revokedTableSet, revokedFiles, revokedGbdbs, pushFiles, pushGbdbs, args, c)) output.extend(self.__printSection(pushTables, untouchedTables, revokedTableSet, allTables, "tables", 0, args['summary'])) output.extend(self.__printSection(pushFiles, untouchedFiles, revokedFiles, allFiles, "download", self.releasePath, args['summary'])) output.extend(self.__printSection(pushGbdbs, untouchedGbdbs, revokedGbdbs, allGbdbs, "gbdbs", self.gbdbPath, args['summary'])) output.extend(self.__printSection(newSupp, untouchedSupp, removedSupp, allSupp, "supplemental", self.releasePath, args['summary'])) #These attributes are the critical ones that are used by qaInit, others could potentially use these also. - self.newTables = set(pushTables) - self.newFiles = set(ucscUtils.printIter(pushFiles, self.releasePath)) - self.newGbdbs = set(ucscUtils.printIter(pushGbdbs, self.gbdbPath)) - self.newSupplemental = set(ucscUtils.printIter(newSupp, self.releasePath)) - self.newOthers = set(ucscUtils.printIter(additionalList, self.releasePath)) + otherprint = len(allOther) if otherprint: output.append("\n") output.append("OTHER FILES:") output.append("New: %s" % len(additionalList)) output.append("Revoked/Replace: %s" % len(removedOther)) output.append("Total: %s" % len(allOther)) if otherprint and not args['summary']: output.append("") output.append("New Other Files (%s):" % len(additionalList)) output.extend(sorted(list(self.newOthers))) output.append("") output.append("Revoked Other Files (%s):" % len(removedOther)) output.extend(ucscUtils.printIter((removedOther), self.releasePath)) @@ -549,34 +541,45 @@ errors.extend(oldTableError) errors.extend(newGbdbError) errors.extend(oldGbdbError) #for ease of typing totalFiles = set(self.newReleaseFiles) oldTotalFiles = set(self.oldReleaseFiles) #these could honestly be moved earlier, get a file list processing section or something #they clean out special fiels out and separated the master fiels list into the 3 required #ones: wgEncode, supplemental and additional. self.totalFiles = self.__cleanSpecialFiles(totalFiles) self.oldTotalFiles = self.__cleanSpecialFiles(oldTotalFiles) (self.oldTotalFiles, self.additionalList, self.oldAdditionalList, self.totalFiles) = self.__separateOutAdditional() - #get the stuff you need to push, also table sizes + #get the stuff you need to push + self.pushTables = set(sorted((self.newTableSet - self.oldTableSet))) + self.pushFiles = set(sorted((self.totalFiles - self.oldTotalFiles))) + self.pushGbdbs = set(sorted((self.newGbdbSet - self.oldGbdbSet))) + self.newSupp = self.newSupplementalSet - self.oldSupplementalSet + + self.newTables = set(self.pushTables) + self.newFiles = set(ucscUtils.printIter(self.pushFiles, self.releasePath)) + self.newGbdbs = set(ucscUtils.printIter(self.pushGbdbs, self.gbdbPath)) + self.newSupplemental = set(ucscUtils.printIter(self.newSupp, self.releasePath)) + self.newOthers = set(ucscUtils.printIter(self.additionalList, self.releasePath)) self.errors = errors #don't output.append(report unless ignore option is on or no errors + #module mode doesn't generate output by default if (not errors) or self.ignore: self.output = self.printReport(args, c) else: self.output = self.printErrors(errors, self.missingFiles) elif self.releaseOld == 'solo': self.newReleaseFiles = c.releases[int(self.releaseNew)-1] self.newMdb = c.alphaMetaDb #check that attic fiels aren't in trackDb errors.extend(self.__checkAtticNotInTrackDb())