import errno
-__version__ = '0.1.1'
+__version__ = '0.1.2'
# =============================================================================
class PpError(Exception):
self.lockfile, self.duration, self.tries)
+# =============================================================================
+class CommandNotFoundError(PpError):
+ """
+ Special exception, if one ore more OS commands were not found.
+
+ """
+
+ # -------------------------------------------------------------------------
+ def __init__(self, cmd_list):
+ """
+ Constructor.
+
+ @param cmd_list: all not found OS commands.
+ @type cmd_list: list
+
+ """
+
+ self.cmd_list = None
+ if cmd_list is None:
+ self.cmd_list = ["Unknown OS command."]
+ elif isinstance(cmd_list, list):
+ self.cmd_list = cmd_list
+ else:
+ self.cmd_list = [cmd_list]
+
+ if len(self.cmd_list) < 1:
+ raise ValueError("Empty command list given.")
+
+ # -------------------------------------------------------------------------
+ def __str__(self):
+ """
+ Typecasting into a string for error output.
+ """
+
+ cmds = ', '.join([("'" + str(x) + "'") for x in self.cmd_list])
+ msg = "Could not found OS command"
+ if len(self.cmd_list) != 1:
+ msg += 's'
+ msg += ": " + cmds
+ return msg
+
+
# =============================================================================
if __name__ == "__main__":
from .common import caller_search_path
from .errors import ReadTimeoutError, WriteTimeoutError
+from .errors import CommandNotFoundError
from .obj import BaseObjectError
from .obj import BaseObject
-__version__ = '0.1.1'
+__version__ = '0.1.2'
log = logging.getLogger(__name__)
pass
-# =============================================================================
-class CommandNotFoundError(BaseHandlerError):
- """
- Special exception, if one ore more OS commands were not found.
-
- """
-
- # -------------------------------------------------------------------------
- def __init__(self, cmd_list):
- """
- Constructor.
-
- @param cmd_list: all not found OS commands.
- @type cmd_list: list
-
- """
-
- self.cmd_list = None
- if cmd_list is None:
- self.cmd_list = ["Unknown OS command."]
- elif isinstance(cmd_list, list):
- self.cmd_list = cmd_list
- else:
- self.cmd_list = [cmd_list]
-
- if len(self.cmd_list) < 1:
- raise ValueError("Empty command list given.")
-
- # -------------------------------------------------------------------------
- def __str__(self):
- """
- Typecasting into a string for error output.
- """
-
- cmds = ', '.join([("'" + str(x) + "'") for x in self.cmd_list])
- msg = "Could not found OS command"
- if len(self.cmd_list) != 1:
- msg += 's'
- msg += ": " + cmds
- return msg
-
-
# =============================================================================
class BaseHandler(BaseObject):
"""