Bopytex/bopytex/message.py
Bertrand Benjamin cd2fdc162e
All checks were successful
continuous-integration/drone/push Build is passing
Fix: run pre-commit hooks
2022-07-28 09:39:51 +02:00

38 lines
737 B
Python

class Message:
def __init__(self, status, out, err):
self._status = status
self._out = out
self._err = err
@property
def status(self):
return self._status
@property
def out(self):
return self._out
@property
def err(self):
return self._err
def __repr__(self):
return f"Message(status={self.status}, out={self.out}, err={self.err})"
class SubprocessMessage(Message):
def __init__(self, process):
self._process = process
@property
def status(self):
return self._process.wait()
@property
def out(self):
return self._process.stdout
@property
def err(self):
return self._process.stderr