class documentation
class Hook(RunAtCommand):
A hook run by one of the scripts
Static Method | md |
Merge two dictionaries a and b into a new one |
Method | __call__ |
Run the command and raise exception on errors |
Method | __init__ |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | run |
Undocumented |
Inherited from Command
(via RunAtCommand
):
Method | call |
Like __call__ but let the caller handle the return status. |
Instance Variable | args |
Undocumented |
Instance Variable | capture |
Undocumented |
Instance Variable | capture |
Undocumented |
Instance Variable | cmd |
Undocumented |
Instance Variable | cwd |
Undocumented |
Instance Variable | env |
Undocumented |
Instance Variable | err |
Undocumented |
Instance Variable | retcode |
Undocumented |
Instance Variable | shell |
Undocumented |
Instance Variable | stderr |
Undocumented |
Instance Variable | stdout |
Undocumented |
Static Method | _f |
Build error string template |
Method | __call |
Wraps subprocess.call so we can be verbose and fix Python's SIGPIPE handling |
Method | _format |
Log an error message |
Method | _log |
Log an error message |
Method | _reset |
Undocumented |
Run the command and raise exception on errors
If run quietly it will not print an error message via the gbp.log
logging API.
Whether the command prints anything to stdout/stderr depends on the capture_stderr, capture_stdout instance variables.
All errors will be reported as subclass of the CommandExecFailed
exception including a non zero exit status of the run command.
Parameters | |
args:list of strings | additional command line arguments |
**kwargs | Undocumented |
quiet: bool >>> Command("/bin/true")(["foo", "bar"]) >>> Command("/foo/bar")(quiet=True) # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... gbp.command_wrappers.CommandExecFailed | don't log failed execution to stderr. Mostly useful during unit testing |