
Public Member Functions | |
| def | __init__ (self, args=None, **kwargs) |
| def | close (self) |
| def | emit (self, topic, msg, stamp=None, match=None, index=None) |
| def | validate (self) |
Public Member Functions inherited from grepros.outputs.Sink | |
| def | __enter__ (self) |
| def | __exit__ (self, exc_type, exc_value, traceback) |
| def | autodetect (cls, target) |
| def | bind (self, source) |
| def | emit_meta (self) |
| def | flush (self) |
| def | is_highlighting (self) |
| def | thread_excepthook (self, text, exc) |
Public Attributes | |
| valid | |
Public Attributes inherited from grepros.outputs.Sink | |
| args | |
| source | |
| inputs.Source instance bound to this sink More... | |
| valid | |
| Result of validate() More... | |
Static Public Attributes | |
| DEFAULT_ARGS = dict(EMIT_FIELD=(), META=False, NOEMIT_FIELD=(), WRITE_OPTIONS={}, VERBOSE=False) | |
| Constructor argument defaults. More... | |
| tuple | FILE_EXTENSIONS = (".csv", ) |
| Auto-detection file extensions. More... | |
Static Public Attributes inherited from grepros.outputs.Sink | |
| DEFAULT_ARGS = dict(META=False) | |
| Constructor argument defaults. More... | |
| tuple | FILE_EXTENSIONS = () |
| Auto-detection file extensions for subclasses, as (".ext", ) More... | |
Private Member Functions | |
| def | _iter_fields (self, msg, top=()) |
| def | _make_writer (self, topic, msg) |
Private Attributes | |
| _close_printed | |
| _filebase | |
| _files | |
| _lasttopickey | |
| _overwrite | |
| _patterns | |
| _writers | |
| def grepros.plugins.auto.csv.CsvSink.__init__ | ( | self, | |
args = None, |
|||
| ** | kwargs | ||
| ) |
@param args arguments as namespace or dictionary, case-insensitive;
or a single path as the base name of CSV files to write
@param args.emit_field message fields to emit in output if not all
@param args.noemit_field message fields to skip in output
@param args.write base name of CSV files to write,
will add topic name like "name.__my__topic.csv" for "/my/topic",
will add counter like "name.__my__topic.2.csv" if exists
@param args.write_options {"overwrite": whether to overwrite existing files
(default false)}
@param args.meta whether to emit metainfo
@param args.verbose whether to emit debug information
@param kwargs any and all arguments as keyword overrides, case-insensitive
Reimplemented from grepros.outputs.Sink.
|
private |
|
private |
| def grepros.plugins.auto.csv.CsvSink.close | ( | self | ) |
Closes output file(s), if any.
Reimplemented from grepros.outputs.Sink.
| def grepros.plugins.auto.csv.CsvSink.emit | ( | self, | |
| topic, | |||
| msg, | |||
stamp = None, |
|||
match = None, |
|||
index = None |
|||
| ) |
Writes message to output file.
Reimplemented from grepros.outputs.Sink.
| def grepros.plugins.auto.csv.CsvSink.validate | ( | self | ) |
Returns whether overwrite option is valid and file base is writable.
Reimplemented from grepros.outputs.Sink.
|
static |
|
static |