big change n parsing logic passing
This commit is contained in:
parent
ca06237c3c
commit
56906b9ebc
17 changed files with 570 additions and 127 deletions
|
|
@ -6,13 +6,21 @@ 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"]
|
||||
def __init__(self, **kwargs):
|
||||
super(ShellService, self).__init__(**kwargs)
|
||||
|
||||
args = self.get_arguments()
|
||||
if "command" in args:
|
||||
self.command = args["command"]
|
||||
else:
|
||||
log.w("There is no command")
|
||||
raise
|
||||
raise Exception("There is no command argument")
|
||||
|
||||
def needs_arguments(self):
|
||||
return True
|
||||
|
||||
|
||||
def execute(self):
|
||||
self.command.call()
|
||||
self.command.call()
|
||||
|
||||
def create(**kwargs):
|
||||
return ShellService(**kwargs)
|
||||
Loading…
Add table
Add a link
Reference in a new issue