2013-05-30 23:07:34 +02:00
|
|
|
"""
|
2013-06-05 04:20:26 +02:00
|
|
|
The shell service. This is for executing local shell commands and retrieve the output.
|
2013-06-05 00:09:24 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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")
|
2013-06-10 05:01:40 +02:00
|
|
|
raise
|
2013-06-05 00:09:24 +02:00
|
|
|
|
|
|
|
|
def execute(self):
|
|
|
|
|
self.command.call()
|