Commands¶
BaseCommand¶
-
class
pybsd.commands.
BaseCommand
(env)[source]¶ Bases:
object
Provides a base interface to a shell command so it can be invoked through a
BaseSystem
Parameters: env ( BaseSystem
) – The system on which the command will be will executed.-
name
¶ str
a name that identifies the command.
-
binary
¶ str
The path of the command binary on the host filesystem.
Raises: InvalidCommandNameError
– raised when a command doesn’t have a nameInvalidCommandExecutorError
– raised when the host system doesn’t have an execyutor or it is not callableCommandNotImplementedError
– raised when the command’s binary does not exist in the host filesystemCommandConnectionError
– raised when connection to a remote host fails
-
invoke
(*args)[source]¶ Executes the command, passing it arguments.
Parameters: args (arguments that are passed to the command at execution time) –
Raises: CommandNotImplementedError
– raised when the command’s binary does not exist in the host filesystemCommandConnectionError
– raised when connection to a remote host fails
-