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
cmd =
Undocumented
args =
Undocumented
run_error =
Undocumented
shell =
Undocumented
retcode =
Undocumented
stderr =
Undocumented
capture_stderr =
Undocumented
cwd =
Undocumented
env =
Undocumented
def __call(self, args):

Wraps subprocess.call so we can be verbose and fix python's SIGPIPE handling

def __run(self, args, quiet=(False)):

run self.cmd adding args as additional arguments

Parametersquietdon'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.

def __call__(self, args=[], quiet=(False)):

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.

Parametersquietdon'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
)
def call(self, args):

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: ...
API Documentation for git-buildpackage, generated by pydoctor at 2021-05-14 08:50:00.