added shell service and fixed service
This commit is contained in:
parent
53e2f2aad0
commit
90c41027c6
2 changed files with 21 additions and 8 deletions
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
class Service:
|
||||
def __init__(self):
|
||||
pass
|
||||
def __init__(self, parser):
|
||||
self.parser = parser
|
||||
|
||||
def _execute(self):
|
||||
self.pre_execute()
|
||||
|
|
@ -16,7 +15,7 @@ class Service:
|
|||
pass
|
||||
|
||||
def parse_result(self):
|
||||
pass
|
||||
self.parser._parse()
|
||||
|
||||
def handle_result(self):
|
||||
pass
|
||||
|
|
@ -1,4 +1,18 @@
|
|||
"""
|
||||
The shell service. This is for executing services as shell commands and don't use a builtin function. This is useful to
|
||||
be free to do what you want.
|
||||
The shell service. This is for executing services as shell commands
|
||||
and don't use a builtin function. This is useful to be free to do what you want.
|
||||
"""
|
||||
|
||||
from service import Service
|
||||
|
||||
|
||||
class ShellService(Service):
|
||||
def __init__(self, parser, log, **kwargs):
|
||||
super(Service, self).__init__(parser)
|
||||
if "command" in kwargs:
|
||||
self.command = kwargs["command"]
|
||||
else:
|
||||
log.w("There is no command")
|
||||
|
||||
def execute(self):
|
||||
self.command.call()
|
||||
Loading…
Add table
Add a link
Reference in a new issue