mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
little docstrings
This commit is contained in:
parent
e132927b73
commit
f170dd1fa8
1 changed files with 8 additions and 0 deletions
|
@ -542,6 +542,10 @@ _CCTuple = namedtuple("_CCTuple", ["stdin",
|
|||
"stderr_redirect"])
|
||||
|
||||
class CompletedCommand(_CCTuple):
|
||||
"""
|
||||
Represents a completed subprocess-mode command.
|
||||
"""
|
||||
|
||||
def __bool__(self):
|
||||
return self.returncode == 0
|
||||
|
||||
|
@ -549,4 +553,8 @@ class CompletedCommand(_CCTuple):
|
|||
return self.returncode == other
|
||||
|
||||
def make_completed_command(**kwargs):
|
||||
"""
|
||||
Make an instance of ``CompletedCommand`` from the specified kwargs. Values
|
||||
not specified via kwargs will default to ``None`` in the resulting object.
|
||||
"""
|
||||
return CompletedCommand(*(kwargs.get(i, None) for i in _CCTuple._fields))
|
||||
|
|
Loading…
Add table
Reference in a new issue