summaryrefslogtreecommitdiff
path: root/summain
diff options
context:
space:
mode:
Diffstat (limited to 'summain')
-rwxr-xr-xsummain10
1 files changed, 7 insertions, 3 deletions
diff --git a/summain b/summain
index b4a2fe5..cf35a41 100755
--- a/summain
+++ b/summain
@@ -72,7 +72,12 @@ class CSV(OutputFormat):
class Json(OutputFormat):
- def write_object(self, name, o):
+ def write(self):
+ json.dump(list(self.dictify(name, o) for name, o in self.objects),
+ self.output, sort_keys=True, indent=1)
+ self.output.write('\n')
+
+ def dictify(self, name, o):
keys = self.keys + self.checksums
values = { 'Name': name }
@@ -80,8 +85,7 @@ class Json(OutputFormat):
if o[k] != '':
values[k] = o[k]
- json.dump(values, self.output, sort_keys=True, indent=1)
- self.output.write('\n')
+ return values
class Summain(cliapp.Application):