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
2015-02-20 22:54:09 -05:00

21 lines
478 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.input_cmd():
yield line
return output_generator()