def _output(self, logType, message, stream, useColors): stream.write('\n') if self._log.hasHeading and logType != LogType.Heading and logType != LogType.HeadingSucceeded and logType != LogType.HeadingFailed: stream.write(' ') if not useColors or logType == LogType.Info: stream.write(message) stream.flush() else: ColorConsole.set_text_attr(self._getColorAttrs(logType)) stream.write(message) stream.flush() ColorConsole.set_text_attr(self._defaultColors)
def _initColors(self): self._defaultColors = ColorConsole.get_text_attr() self._defaultBg = self._defaultColors & 0x0070 self._defaultFg = self._defaultColors & 0x0007