summaryrefslogtreecommitdiff
path: root/source-stats
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-06-18 17:37:28 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-06-18 17:37:28 +0100
commitce160cb76d0537fb9efec804106b6fbfafcc9b56 (patch)
tree6d5bd8c9d3bf2e713b23773e665b844913c122fb /source-stats
parentb1f9187f478be1fbe3ff5602f8deed9caac799c4 (diff)
downloadmorph-ce160cb76d0537fb9efec804106b6fbfafcc9b56.tar.gz
Change source-stats to take directories instead of morph filenames
Diffstat (limited to 'source-stats')
-rwxr-xr-xsource-stats16
1 files changed, 4 insertions, 12 deletions
diff --git a/source-stats b/source-stats
index b657cd37..429d9e9c 100755
--- a/source-stats
+++ b/source-stats
@@ -36,7 +36,7 @@ class SourceStats(cliapp.Application):
* lines added over 12 months
* lines removed over 12 months
- Usage: ./source-stat $HOME/baserock/gits/*.morph
+ Usage: ./source-stat $HOME/baserock/gits/*
'''
@@ -48,20 +48,12 @@ class SourceStats(cliapp.Application):
self.cols = ['name', 'lines', 'commits', 'added', 'deleted']
self.writer.writerow(self.cols)
- def process_input(self, filename):
- with self.open_input(filename) as f:
- obj = json.load(f)
-
- if obj['kind'] != 'chunk':
- return
-
- gitdir = os.path.dirname(filename)
- name = obj['name']
-
+ def process_input(self, gitdir):
+ name = os.path.basename(gitdir)
stats = self.compute_stats(name, gitdir)
row = [stats[x] for x in self.cols]
self.writer.writerow(row)
- self.output.flush()
+ sys.stdout.flush()
def compute_stats(self, name, gitdir):
stats = {