20 from .comments
import CommentCache, Comments
21 from .settings
import Documentation, MetadataList
28 raise NotImplementedError
31 raise NotImplementedError
62 return row.is_commented()
76 return row.is_continuing()
and self.
_populator_populator
79 raise NotImplementedError
83 def _consume_comments(self):
84 self._comment_cache.consume_with(self._populator.add)
86 def _consume_standalone_comments(self):
87 self._consume_comments()
98 setter = self.
_table_table.get_setter(row.head)
if row.head
else None
101 if isinstance(setter.__self__, Documentation):
103 if isinstance(setter.__self__, MetadataList):
118 populator.add(comment)
129 return row.is_indented()
and self.
_populator_populator
or row.is_commented()
132 return row.is_commented()
and not self.
_populator_populator
159 if not self.
_loop_loop:
161 if not declaration_ready:
164 if not row.is_continuing():
171 if row.starts_for_loop()
or row.is_continuing():
183 if not self.
_loop_loop:
206 dedented_row = row.dedent()
212 ending_for_loop =
False
215 if row.all == [
'END']:
232 return isinstance(self.
_populator_populator, ForLoopPopulator)
235 return (row.is_continuing()
and self.
_populator_populator
or
249 if row.starts_test_or_user_keyword_setting():
253 if isinstance(setter.__self__, Documentation):
262 setting_name = row.test_or_user_keyword_setting_name()
263 return self.
_test_or_uk_test_or_uk.get_setter(setting_name)
270 _item_type =
'test case'
277 _item_type =
'keyword'
291 if not row.is_commented():
296 if row.cells == [
'...']:
298 self.
_value_value.extend(row.tail
if not self.
_data_added_data_added
else row.data)
303 message = (
"%sIgnoring lines with only continuation marker '...' is "
304 "deprecated." % (
'In %s: ' % location
if location
else ''))
305 self.
_setter_setter.__self__.report_invalid_syntax(message, level=
'WARN')
314 _PropertyPopulator.__init__(self, setter)
321 return "'Variables' section"
330 return "'%s' setting" % self.
_setter_setter.__self__.setting_name
337 _end_of_line_escapes = re.compile(
r'(\\+)n?$')
348 self.
_value_value.append(joiner)
349 self.
_value_value.append(
' '.join(data))
357 return not self.
_value_value
or \
358 (len(self.
_value_value) == 1
and self.
_value_value[0] ==
'')
362 if not match
or len(match.group(1)) % 2 == 0:
364 if not match.group(0).endswith(
'n'):
372 _PropertyPopulator.__init__(self, setter)
379 data = row.dedent().data
380 if self.
_name_name
is None:
381 self.
_name_name = data[0]
if data
else ''
389 if row.cells == [
'...']:
391 self.
_value_value.extend(row.data)
def _joiner_based_on_eol_escapes(self)
def _add_to_value(self, data)
def _populate_declaration(self, row)
def _create_for_loop(self)
def __init__(self, for_loop_creator)
def _get_populator(self, row)
Explicit interface for all populators.
def _get_deprecation_location(self)
def _get_populator(self, row)
def _get_populator(self, row)
def _get_deprecation_location(self)
def __init__(self, setter, name)
def _get_populator(self, row)
def _populate_standalone_comment(self, comment)
def _consume_standalone_comments(self)
def _deprecate_continuation_without_values(self)
def __init__(self, setter)
def _get_deprecation_location(self)
def _is_cacheable_comment_row(self, row)
def _is_continuing(self, row)
def _get_populator(self, row)
def _is_cacheable_comment_row(self, row)
def _is_continuing(self, row)
def __init__(self, table)
def _get_populator(self, row)
def _populating_for_loop(self)
def _setting_setter(self, row)
def _continues(self, row)
def __init__(self, test_or_uk_creator)
def _populate_comment_row(self, crow)
def _handle_data_row(self, row)