27 _empty_cell_escape =
''
31 _line_continuation =
'...'
35 _setting_table =
'setting'
39 _indented_tables = (
'test case',
'keyword')
43 _split_from = (
'ELSE',
'ELSE IF',
'AND')
45 def __init__(self, cols=8, split_multiline_doc=False):
49 def split(self, row, table_type):
52 indent = self.
_get_indent_get_indent(row, table_type)
63 return max(indent, min_indent)
66 ignore = [
'',
'...']
if indented
else [
'']
67 return len(list(itertools.takewhile(
lambda x: x
in ignore, row)))
71 return len(row) > 1
and row[0] ==
'Documentation'
73 return len(row) > 2
and row[1] ==
'[Documentation]'
77 first, rest = self.
_split_doc_split_doc(row[indent+1])
78 yield row[:indent+1] + [first] + row[indent+2:]
80 current, rest = self.
_split_doc_split_doc(rest)
81 row = [current]
if current
else []
88 doc = doc.replace(
'\\n ',
'\\n')
89 return doc.split(
'\\n', 1)
93 current, row = self.
_split_split(row)
100 current, rest = data[:index], data[index:]
107 if marker
in data[min_index:]:
108 yield data[min_index:].index(marker) + min_index
109 yield self.
_cols_cols
112 if rest
and any(c.startswith(self.
_comment_mark_comment_mark)
for c
in current) \
114 rest = [self.
_comment_mark_comment_mark +
' ' + rest[0]] + rest[1:]
118 if row
and not row[-1].strip():
124 if indent + 1 < self.
_cols_cols:
125 row = [
''] * indent + row
string _empty_cell_escape
def _split_empty_row(self)
def _split_doc_row(self, row, indent)
def _escape_last_cell_if_empty(self, row)
def _get_first_non_empty_index(self, row, indented=False)
def split(self, row, table_type)
def _continue_row(self, row, indent)
def _get_indent(self, row, table_type)
def _get_possible_split_indices(self, data)
def _is_doc_row(self, row, table_type)
def _split_doc(self, doc)
def _comment_rest_if_needed(self, current, rest)
def _split_row(self, row, indent)
string _line_continuation
def __init__(self, cols=8, split_multiline_doc=False)