summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-11-03 23:29:02 (GMT)
committerSteven Knight <knight@baldmt.com>2003-11-03 23:29:02 (GMT)
commit6c596f1833a9e169e97356721d82a1ccf5fa37cc (patch)
tree387b2d0018114bbc86c7cd916ee8987c77e5a6ee /bin
parentd64a435c6ad5196230fea4e8637d1ba03959b676 (diff)
downloadSCons-6c596f1833a9e169e97356721d82a1ccf5fa37cc.zip
SCons-6c596f1833a9e169e97356721d82a1ccf5fa37cc.tar.gz
SCons-6c596f1833a9e169e97356721d82a1ccf5fa37cc.tar.bz2
Sync CVS log from master Aegis repository.
Diffstat (limited to 'bin')
-rw-r--r--bin/linecount9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/linecount b/bin/linecount
index 6034208..e344e2a 100644
--- a/bin/linecount
+++ b/bin/linecount
@@ -55,8 +55,17 @@ nbsl = filter(lambda x: x != '', slines)
nctl = filter(lambda x: x[0] != '#', nbtl)
ncsl = filter(lambda x: x[0] != '#', nbsl)
+def ratio(over, under):
+ return "%.2f" % (float(len(over)) / float(len(under)))
+
+rfiles = ratio(tests, sources)
+rlines = ratio(tlines, slines)
+rnonblank = ratio(nbtl, nbsl)
+rnoncomment = ratio(nctl, ncsl)
+
fmt = "%-8s %12s %12s %12s %12s"
print fmt % ('', 'files', 'lines', 'non-blank', 'non-comment')
print fmt % ('tests:', len(tests), len(tlines), len(nbtl), len(nctl))
print fmt % ('sources:', len(sources), len(slines), len(nbsl), len(ncsl))
+print fmt % ('ratio:', rfiles, rlines, rnonblank, rnoncomment)