Wraps a shell command, so we don't have to store any kind of command
line options in one of the git-buildpackage commands
|
__call(self,
args)
Wraps subprocess.call so we can be verbose and fix Python's SIGPIPE
handling |
|
|
|
__call__(self,
args=[ ] ,
quiet=False)
Run the command and raise exception on errors |
|
|
|
__init__(self,
cmd,
args=[ ] ,
shell=False,
extra_env=None,
cwd=None,
capture_stderr=False,
capture_stdout=False)
x.__init__(...) initializes x; see help(type(x)) for signature |
|
|
|
|
|
_log_err(self)
Log an error message |
|
|
|
|
int
>>> Command("/bin/true").call(["foo", "bar"])
0
>>> Command("/foo/bar").call(["foo", "bar"])
Traceback (most recent call last):
...
CommandExecFailed: execution failed: ...
>>> c = Command("/bin/true", capture_stdout=True)
>>> c.call(["--version"])
0
>>> c.stdout.decode('utf-8').startswith('true')
True
>>> c = Command("/bin/false", capture_stdout=True)
>>> c.call(["--help"])
1
>>> c.stdout.decode('utf-8').startswith('Usage:')
True
|
call(self,
args,
quiet=True)
Like __call__ but let the caller handle the return
status. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|