Package linspector :: Package lib :: Package services :: Module shell
[hide private]
[frames] | no frames]

Source Code for Module linspector.lib.services.shell

 1  """ 
 2  The shell service. This is for executing local shell commands and retrieve the output. 
 3  """ 
 4   
 5  from service import Service 
 6   
 7   
8 -class ShellService(Service):
9 - def __init__(self, **kwargs):
10 super(ShellService, self).__init__(**kwargs) 11 12 args = self.get_arguments() 13 if "command" in args: 14 self.command = args["command"] 15 else: 16 raise Exception("There is no command argument")
17
18 - def needs_arguments(self):
19 return True
20
21 - def execute(self):
22 self.command.call()
23 24
25 -def create(**kwargs):
26 return ShellService(**kwargs)
27