Skip to content

Commit 7be40cf

Browse files
committed
feat(subprocess): Stub out composable mixins
1 parent 22e9dff commit 7be40cf

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

libvcs/_internal/subprocess.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,3 +350,38 @@ def run(
350350
timeout=timeout,
351351
check=check,
352352
)
353+
354+
355+
#
356+
# Composable mixins
357+
#
358+
359+
360+
class TeeStdoutMixin:
361+
def stdout_callback(self, *args, **kwargs):
362+
raise NotImplementedError
363+
364+
def get_stdout_callback(self):
365+
return self.stdout_callback
366+
367+
368+
class TeeStderrMixin:
369+
def stderr_callback(self, *args, **kwargs):
370+
raise NotImplementedError
371+
372+
def get_stderr_callback(self):
373+
return self.stderr_callback
374+
375+
376+
class CaptureStdoutMixin:
377+
"""Logs all stdout
378+
379+
Compatible with TeeStdout. Makes it possible to stream output and look back.
380+
"""
381+
382+
383+
class CaptureStderrMixin:
384+
"""Logs all stderr
385+
386+
Compatible with TeeStderr. Makes it possible to stream output and look back.
387+
"""

0 commit comments

Comments
 (0)