19 from robot.utils import (get_console_length, getshortdoc, isatty,
22 from .highlighting
import HighlightingStream
27 def __init__(self, width=78, colors='AUTO', markers='AUTO', stdout=None,
36 self.
_writer_writer.suite_separator()
38 self.
_writer_writer.
info(suite.longname, suite.doc, start_suite=
True)
39 self.
_writer_writer.suite_separator()
43 self.
_writer_writer.status(suite.status)
45 self.
_writer_writer.suite_separator()
52 self.
_writer_writer.status(test.status, clear=
True)
54 self.
_writer_writer.test_separator()
63 self.
_writer_writer.keyword_marker(kw.status)
66 if msg.level
in (
'WARN',
'ERROR'):
70 self.
_writer_writer.output(name, path)
77 _status_length = len(
'| PASS |')
79 def __init__(self, width=78, colors='AUTO', markers='AUTO', stdout=None,
87 def info(self, name, doc, start_suite=False):
98 return self.
_width_width,
'\n'
105 info =
'%s :: %s' % (name, doc)
if doc
else name
121 self.
_stdout_stdout.highlight(status, flush=
False)
145 def error(self, message, level, clear=False):
153 self.
_stdout_stdout.
write(
'%-8s %s\n' % (name+
':', path))
164 options = {
'AUTO':
isatty(highlighter.stream),
168 return options[markers.upper()]
170 raise DataError(
"Invalid console marker value '%s'. Available "
171 "'AUTO', 'ON' and 'OFF'." % markers)
175 marker, status = (
'.',
'PASS')
if status !=
'FAIL' else (
'F',
'FAIL')
def __init__(self, highlighter, markers)
def _marking_enabled(self, markers, highlighter)
def start_keyword(self, kw)
def __init__(self, width=78, colors='AUTO', markers='AUTO', stdout=None, stderr=None)
def end_suite(self, suite)
def start_suite(self, suite)
def end_keyword(self, kw)
def output_file(self, name, path)
def start_test(self, test)
def suite_separator(self)
def __init__(self, width=78, colors='AUTO', markers='AUTO', stdout=None, stderr=None)
def info(self, name, doc, start_suite=False)
def _get_info(self, name, doc, width)
def message(self, message)
def status(self, status, clear=False)
def _should_clear_markers(self, clear)
def _get_info_width_and_separator(self, start_suite)
def keyword_marker(self, status)
def error(self, message, level, clear=False)
def output(self, name, path)
def info(msg, html=False, also_console=False)
Writes the message to the log file using the INFO level.
def write(msg, level='INFO', html=False)
Writes the message to the log file using the given level.
def error(msg, html=False)
Writes the message to the log file using the ERROR level.
def getshortdoc(doc_or_item, linesep='\n')
def get_console_length(text)
def pad_console_length(text, width)