19 lines
479 B
Python
19 lines
479 B
Python
from psh.commands import BaseCommand
|
|
|
|
from io import StringIO
|
|
|
|
class TestFormatter(BaseCommand):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
super(TestFormatter, self).__init__(*args, **kwargs)
|
|
self.buffer = StringIO()
|
|
|
|
def call(self):
|
|
input_generator = self.get_input_generator()
|
|
for line in input_generator:
|
|
self.buffer.write(line.decode('utf-8'))
|
|
return None
|
|
|
|
def get_data(self):
|
|
return self.buffer.getvalue()
|