From 6ffce4cf6e79af4b2d6b1379c08d9f1e4c80724e Mon Sep 17 00:00:00 2001 From: James Turk Date: Sun, 21 Feb 2010 14:21:19 -0500 Subject: [PATCH] minor cleanups in emitters --- saucebrush/emitters.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/saucebrush/emitters.py b/saucebrush/emitters.py index 636cd08..d965b49 100644 --- a/saucebrush/emitters.py +++ b/saucebrush/emitters.py @@ -11,14 +11,10 @@ class Emitter(Filter): All derived emitters must provide an emit_record(self, record) that takes a single record (python dictionary). - Emitters can optionally define a close() method that is called after + Emitters can optionally define a done() method that is called after all records are processed (allowing database flushes, or printing of aggregate data). """ - - def __init__(self): - super(Emitter, self).__init__() - def process_record(self, record): self.emit_record(record) return record @@ -64,7 +60,7 @@ class CSVEmitter(Emitter): records to a csvfile with the columns in the order specified. """ - def __init__(self, csvfile, fieldnames=None): + def __init__(self, csvfile, fieldnames): super(CSVEmitter, self).__init__() import csv self._dictwriter = csv.DictWriter(csvfile, fieldnames)