"""
From raw new data create some yield-able results.
- Intended for overwriting in sub-classes.
+ Intended for overwriting in subclasses.
This function is called from __iter__ for each new data that becomes
available. It has to return some iterable whose entries are yielded
from iteration over objects of this class.
- The result must be an iterable of objects, which are yielded as-is, so
- can have any form.
-
This base implementation just returns its input in a list, so new data
- is yielded from __iter__ as-is.
-
- Subclass implementations can also yield tuples.
+ is yielded from __iter__ as-is. Subclass implementations can also yield
+ tuples.
:param str description: Description of source of lines, one of
:py:data:`self.descriptions`
- :param str new_data: Text data read from source
+ :param str data: Text data read from source
:param idx: Index of data source
:returns: [(description, data, idx], same as input
:rtype [(str, str, int)]
super(LogParser, self).prepare_result(*args):
result = re.match(self.pattern, raw_line)
if result:
- return (description, result, idx)
+ return description, result, idx
else:
- return (description, raw_line, idx)
+ return description, raw_line, idx