|
@@ -8,6 +8,13 @@ logger = logging.getLogger("kalliope")
|
|
|
|
|
|
|
|
|
|
class AsyncShell(threading.Thread):
|
|
class AsyncShell(threading.Thread):
|
|
|
|
+
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+ Class used to run an asynchrone Shell command
|
|
|
|
+
|
|
|
|
+ .. notes:: Impossible to get the success code of the command
|
|
|
|
+ """
|
|
def __init__(self, cmd):
|
|
def __init__(self, cmd):
|
|
self.stdout = None
|
|
self.stdout = None
|
|
self.stderr = None
|
|
self.stderr = None
|
|
@@ -24,6 +31,10 @@ class AsyncShell(threading.Thread):
|
|
|
|
|
|
|
|
|
|
class Shell(NeuronModule):
|
|
class Shell(NeuronModule):
|
|
|
|
+
|
|
|
|
+ """
|
|
|
|
+ Run a shell command in a synchron mode
|
|
|
|
+ """
|
|
def __init__(self, **kwargs):
|
|
def __init__(self, **kwargs):
|
|
super(Shell, self).__init__(**kwargs)
|
|
super(Shell, self).__init__(**kwargs)
|
|
|
|
|
|
@@ -50,8 +61,10 @@ class Shell(NeuronModule):
|
|
|
|
|
|
def _is_parameters_ok(self):
|
|
def _is_parameters_ok(self):
|
|
"""
|
|
"""
|
|
- Check if received parameters are ok to perform operations in the neuron
|
|
|
|
- :return: true if parameters are ok, raise an exception otherwise
|
|
|
|
|
|
+ Check if received parameters are ok to perform operations in the neuron
|
|
|
|
+ :return: true if parameters are ok, raise an exception otherwise
|
|
|
|
+
|
|
|
|
+ .. raises:: MissingParameterException
|
|
"""
|
|
"""
|
|
if self.cmd is None:
|
|
if self.cmd is None:
|
|
raise MissingParameterException("cmd parameter required")
|
|
raise MissingParameterException("cmd parameter required")
|