Lines Matching full:stream
14 from ..PrettyOutputBase import PrettyOutputBase, Stream, _lock, _null_lock
30 stdout = Stream(sys.stdout, ctypes.windll.kernel32.GetStdHandle(-11))
31 stderr = Stream(sys.stderr, ctypes.windll.kernel32.GetStdHandle(-12))
46 def _restore_orig_color(self, stream, lock=_lock): argument
47 if not stream.color_enabled:
51 stream = self._set_valid_stream(stream)
52 self.flush(stream)
53 if stream.orig_color:
55 stream.os, stream.orig_color
58 def _color(self, text, color, stream, lock=_lock): argument
59 stream = self._set_valid_stream(stream)
62 if stream.color_enabled:
63 ctypes.windll.kernel32.SetConsoleTextAttribute(stream.os, color)
64 self._write(text, stream)
66 if stream.color_enabled:
67 self._restore_orig_color(stream, lock=_null_lock)
69 def red_impl(self, text, stream=None, **kwargs): argument
70 self._color(text, 12, stream, **kwargs)
72 def yellow_impl(self, text, stream=None, **kwargs): argument
73 self._color(text, 14, stream, **kwargs)
75 def green_impl(self, text, stream=None, **kwargs): argument
76 self._color(text, 10, stream, **kwargs)
78 def blue_impl(self, text, stream=None, **kwargs): argument
79 self._color(text, 11, stream, **kwargs)
81 def default_impl(self, text, stream=None, **kwargs): argument
82 stream = self._set_valid_stream(stream)
83 self._color(text, stream.orig_color, stream, **kwargs)