Revision 14599
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/lib/csvs.py | ||
---|---|---|
151 | 151 |
|
152 | 152 |
def close(self): pass # support using as a stream |
153 | 153 |
|
154 |
class MultiFilter(Filter): |
|
155 |
'''enables applying multiple filters by nesting |
|
156 |
@param wrapped_reader outermost_filter(innermost_filter(reader)) |
|
157 |
''' |
|
158 |
def __init__(self, wrapped_reader): |
|
159 |
def filter_(row): return row # no-op b/c filtering applied by nesting |
|
160 |
Filter.__init__(self, filter_, wrapped_reader) |
|
161 |
|
|
154 | 162 |
std_nulls = [r'\N'] |
155 | 163 |
empty_nulls = [''] + std_nulls |
156 | 164 |
|
Also available in: Unified diff
lib/csvs.py: added MultiFilter, which enables applying multiple filters by nesting