20 lines
488 B
Python
20 lines
488 B
Python
from commands import BaseCommand, register_cmd
|
|
|
|
@register_cmd
|
|
class example_cmd(BaseCommand):
|
|
def __call__(self, *args, **kwargs):
|
|
def output_generator():
|
|
yield b'example'
|
|
yield b'command'
|
|
return output_generator()
|
|
|
|
|
|
@register_cmd
|
|
class echo(BaseCommand):
|
|
def __call__(self,*args,**kwargs):
|
|
def output_generator():
|
|
for line in self.cmd_args:
|
|
yield line.encode('utf-8')
|
|
return output_generator()
|
|
|