allow user cleaning path via self.command_path=None or self.command_path=""
@@ -34,7 +34,7 @@ class CommandTextualGeneric(Command):
:param newline_chars: new line chars on device (a list).
:param runner: runner to run command.
"""
- self.command_path = '' # path to command executable - allow non standard locations like /usr/local/bin/
+ self.command_path = None # path to command executable - allow non standard locations like /usr/local/bin/
self._max_index_from_beginning = 20 # Right (from 0 to this) index of substring of command_string passed
# as _cmd_escaped. Set 0 to disable functionality of substring.
self._max_index_from_end = 20 # Left (from this to the end) index of substring of command_string passed
@@ -80,7 +80,10 @@ class CommandTextualGeneric(Command):
self.__command_string = "CANNOT BUILD COMMAND STRING" # To avoid infinite recursion if
# build_command_string raises an exception.
command_string = self.build_command_string()
+ if self.command_path:
self.__command_string = "{}{}".format(self.command_path, command_string)
+ else:
+ self.__command_string = command_string
finally:
self._build_command_string_escaped()
return self.__command_string
