d0ee32c6e6eb5f7ae9518c3da0d98bdae1b5575c wong Tue Feb 7 11:20:18 2012 -0800 changed calculation method to round at the end diff --git python/lib/ucscgenomics/mkChangeNotes.py python/lib/ucscgenomics/mkChangeNotes.py index c8d98fb..fcc5a3b 100644 --- python/lib/ucscgenomics/mkChangeNotes.py +++ python/lib/ucscgenomics/mkChangeNotes.py @@ -163,38 +163,39 @@ return (gbdbfileset, revokedfileset, errors) def __getTableSize(self): (mdbtableset, database) = (self.newTableSet, self.database) tablesize = float(0) tablelist = list() for i in mdbtableset: tablelist.append("table_name = '%s'" % i) orsep = " OR " orstr = orsep.join(tablelist) - cmd = "hgsql %s -e \"SELECT ROUND(data_length/1024/1024,2) total_size_mb, ROUND(index_length/1024/1024,2) total_index_size_mb FROM information_schema.TABLES WHERE %s\"" % (database, orstr) + cmd = "hgsql %s -e \"SELECT ROUND(data_length,2) total_size_mb, ROUND(index_length,2) total_index_size_mb FROM information_schema.TABLES WHERE %s\"" % (database, orstr) p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) cmdoutput = p.stdout.read() for i in cmdoutput.split("\n")[1:-1]: fields = i.split() for j in fields: tablesize = tablesize + float(j) + tablesize = tablesize/(1024 ** 2) return int(math.ceil(tablesize)) def __checkMd5sums(self): (newfiles, oldfiles, loose) = (self.newReleaseFiles, self.oldReleaseFiles, self.loose) errors = [] repush = set() for i in oldfiles: if i not in newfiles: pass elif re.match('wgEncode.*', i): if oldfiles[i].md5sum != newfiles[i].md5sum: repush.add(i) errors.append("file: %s have changed md5sums between releases. %s vs %s" % (i, oldfiles[i].md5sum, newfiles[i].md5sum)) if loose: