Fix example commands
This commit is contained in:
parent
9324774208
commit
80ac53e72e
@ -4,17 +4,17 @@ from commands import BaseCommand, register_cmd
|
||||
class example_cmd(BaseCommand):
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
def input_generator():
|
||||
yield 'example'
|
||||
yield 'command'
|
||||
return input_generator
|
||||
def output_generator():
|
||||
yield b'example'
|
||||
yield b'command'
|
||||
return output_generator()
|
||||
|
||||
|
||||
@register_cmd
|
||||
class echo(BaseCommand):
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
def input_generator():
|
||||
def output_generator():
|
||||
for line in self.input_cmd():
|
||||
yield line
|
||||
return input_generator
|
||||
return output_generator()
|
||||
|
Reference in New Issue
Block a user