diff options
author | Steven Knight <knight@baldmt.com> | 2003-11-03 23:29:02 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-11-03 23:29:02 (GMT) |
commit | 6c596f1833a9e169e97356721d82a1ccf5fa37cc (patch) | |
tree | 387b2d0018114bbc86c7cd916ee8987c77e5a6ee /bin/linecount | |
parent | d64a435c6ad5196230fea4e8637d1ba03959b676 (diff) | |
download | SCons-6c596f1833a9e169e97356721d82a1ccf5fa37cc.zip SCons-6c596f1833a9e169e97356721d82a1ccf5fa37cc.tar.gz SCons-6c596f1833a9e169e97356721d82a1ccf5fa37cc.tar.bz2 |
Sync CVS log from master Aegis repository.
Diffstat (limited to 'bin/linecount')
-rw-r--r-- | bin/linecount | 9 |
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) |