Bopytex/bopytex/message.py

37 lines
738 B
Python
Raw Normal View History

2022-04-13 10:26:04 +00:00
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})"
2022-04-13 10:26:04 +00:00
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