gbp.command_wrappers.Command(object)
class documentationgbp.command_wrappers
(View In Hierarchy)
Known subclasses: gbp.command_wrappers.CatenateTarArchive, gbp.command_wrappers.CatenateZipArchive, gbp.command_wrappers.Dch, gbp.command_wrappers.DpkgSourceExtract, gbp.command_wrappers.GitCommand, gbp.command_wrappers.PackTarArchive, gbp.command_wrappers.RemoveTree, gbp.command_wrappers.RunAtCommand, gbp.command_wrappers.UnpackTarArchive, gbp.command_wrappers.UnpackZipArchive, gbp.deb.DpkgCompareVersions, gbp.pkg.pristinetar.PristineTar
Wraps a shell command, so we don't have to store any kind of command line options in one of the git-buildpackage commands
Method | __init__ | Undocumented |
Instance Variable | cmd | Undocumented |
Instance Variable | args | Undocumented |
Instance Variable | run_error | Undocumented |
Instance Variable | shell | Undocumented |
Instance Variable | retcode | Undocumented |
Instance Variable | stderr | Undocumented |
Instance Variable | capture_stderr | Undocumented |
Instance Variable | cwd | Undocumented |
Instance Variable | env | Undocumented |
Method | __call__ | Run the command and convert all errors into CommandExecFailed. Assumes that the lower levels printed an error message (the command itself and also via our logging api) - only useful if you only expect 0 as result. |
Method | call | Like __call__ but let the caller handle the return status and don't use the logging api for errors. |
Method | __call | Wraps subprocess.call so we can be verbose and fix python's SIGPIPE handling |
Method | __run | run self.cmd adding args as additional arguments |
Wraps subprocess.call so we can be verbose and fix python's SIGPIPE handling
run self.cmd adding args as additional arguments
Parameters | quiet | don't log errors to stderr Mostly useful during unit testing. Be verbose about errors and encode them in the return value, don't pass on exceptions. |
Run the command and convert all errors into CommandExecFailed. Assumes that the lower levels printed an error message (the command itself and also via our logging api) - only useful if you only expect 0 as result.
Parameters | quiet | don't log failed execution to stderr. Mostly useful during unit testing (type: bool >>> Command("/bin/true")(["foo", "bar"]) >>> Command("/foo/bar")(quiet=True) Traceback (most recent call last): ... CommandExecFailed) |
Like __call__ but let the caller handle the return status and don't use the logging api for errors.
>>> Command("/bin/true").call(["foo", "bar"]) 0 >>> Command("/foo/bar").call(["foo", "bar"]) # doctest:+ELLIPSIS Traceback (most recent call last): ... CommandExecFailed: Execution failed: ...