/usr/lib/python2.7/dist-packages/stetl/outputs/standardoutput.py is in python-stetl 1.1+ds-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | # -*- coding: utf-8 -*-
#
# Output classes for ETL.
#
# Author: Just van den Broecke
#
from stetl.output import Output
from stetl.util import Util
from stetl.packet import FORMAT
log = Util.get_log('standardoutput')
#
class StandardOutput(Output):
"""
Print any input to standard output.
consumes=FORMAT.any
"""
def __init__(self, configdict, section):
Output.__init__(self, configdict, section, consumes=FORMAT.any)
def write(self, packet):
if packet.data is None:
return packet
# Default: print to stdout
print(packet.to_string())
return packet
class StandardXmlOutput(Output):
"""
Pretty print XML from etree doc to standard output. OBSOLETE, can be done with StandardOutput
consumes=FORMAT.etree_doc
"""
def __init__(self, configdict, section):
Output.__init__(self, configdict, section, consumes=FORMAT.etree_doc)
def write(self, packet):
if packet.data is None:
return packet
# Default: print to stdout
print(packet.to_string())
return packet
|