

def output(self, data):
    'Outputs the provided data using the transformations and output format specified for this CLI endpoint'
    if self.transform:
        data = self.transform(data)
    if hasattr(data, 'read'):
        data = data.read().decode('utf8')
    if (data is not None):
        data = self.outputs(data)
        if data:
            sys.stdout.buffer.write(data)
            if (not data.endswith(b'\n')):
                sys.stdout.buffer.write(b'\n')
    return data

dataset/ETHPy150Open timothycrosley/hug/hug/interface.py CLI.output/original