# HG changeset patch # User Jeff Hammel # Date 1425230978 28800 # Node ID 8bfa28ff74ce5fd2af01dc23699ae88b5bb81819 # Parent c70ef55b61412b35bcc35f302bce486720d2fffa use that thing we made diff -r c70ef55b6141 -r 8bfa28ff74ce numerics/read.py --- a/numerics/read.py Sun Mar 01 09:19:25 2015 -0800 +++ b/numerics/read.py Sun Mar 01 09:29:38 2015 -0800 @@ -10,7 +10,7 @@ import csv import os import sys - +from .write import CSVWriter # module globals __all__ = ['main', 'CSVParser'] @@ -154,9 +154,9 @@ data = parser.read() # write CSV - writer = csv.writer(options.output) - for row in data: - writer.writerow(row) + writer = CSVWriter(options.output) + writer.write(data) + if __name__ == '__main__': main() diff -r c70ef55b6141 -r 8bfa28ff74ce numerics/write.py --- a/numerics/write.py Sun Mar 01 09:19:25 2015 -0800 +++ b/numerics/write.py Sun Mar 01 09:29:38 2015 -0800 @@ -24,7 +24,7 @@ self.f = f self.writer = csv.writer(f) - def writerow(*row): + def writerow(self, *row): self.writer.writerow(row) self.f.flush() __call__ = writerow