From 04b4adafda8921b50518cc091ce75398e0f5dfd6 Mon Sep 17 00:00:00 2001 From: depristo Date: Wed, 6 Oct 2010 21:54:23 +0000 Subject: [PATCH] File reports are now sorted in order git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4447 348d0f76-0448-11de-a6fe-93d51630548a --- python/Verify1KGArchiveBAMs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/Verify1KGArchiveBAMs.py b/python/Verify1KGArchiveBAMs.py index ec296900a..cf576f96a 100644 --- a/python/Verify1KGArchiveBAMs.py +++ b/python/Verify1KGArchiveBAMs.py @@ -220,6 +220,9 @@ def printHeaderSep(): print print ''.join(['-'] * 80) +def sortByName(files): + return sorted(files, key=lambda x: x.file) + if __name__ == "__main__": usage = "usage: %prog -l and/or -a root ftpRoot" parser = OptionParser(usage=usage) @@ -272,7 +275,7 @@ if __name__ == "__main__": print 'SUMMARY: Total files examined', len(results) for status in ['in-sync', 'size-mismatch', 'unknown-local-file', 'local-file-missing', 'orphaned-file']: printHeaderSep() - filesOfStatus = filter(lambda x: x.status == status, results.itervalues()) + filesOfStatus = sortByName(filter(lambda x: x.status == status, results.itervalues())) n = len(filesOfStatus) print 'SUMMARY: %s' % ( status ) print 'SUMMARY: Files %d (%.2f%% of total)' % ( n, n * 100.0 / len(results))