This repository has been archived on 2015-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
psh/example_cmd.py

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()