Skip to content

Commit c849487

Browse files
committed
feat(subprocess): Stub out composable mixins
1 parent 12df145 commit c849487

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

libvcs/utils/subprocess.py

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

0 commit comments

Comments
 (0)