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):
|
class example_cmd(BaseCommand):
|
||||||
|
|
||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
def input_generator():
|
def output_generator():
|
||||||
yield 'example'
|
yield b'example'
|
||||||
yield 'command'
|
yield b'command'
|
||||||
return input_generator
|
return output_generator()
|
||||||
|
|
||||||
|
|
||||||
@register_cmd
|
@register_cmd
|
||||||
class echo(BaseCommand):
|
class echo(BaseCommand):
|
||||||
|
|
||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
def input_generator():
|
def output_generator():
|
||||||
for line in self.input_cmd():
|
for line in self.input_cmd():
|
||||||
yield line
|
yield line
|
||||||
return input_generator
|
return output_generator()
|
||||||
|
Reference in New Issue
Block a user