Module transform_feedparser_data
source code
This takes the feedparser tests from here:
http://feedparser.org/tests/wellformed/sanitize/
and rewrites them to be easier to handle (not using the internal model
of feedparser). The input format is::
<!--
Description: {description}
Expect: {expression}
-->
...
<content ...>{content}</content>
...
The Expect expression is checked for
``entries[0]['content'][0]['value'] == {data}``.
The output format is::
Description: {description}
Expect: {expression} (if data couldn't be parsed)
Options:
{content, unescaped}
----------
{data, unescaped, if found}
|
_desc_re = re.compile(r'\s* Description:\s* ( .* ) ')
|
|
_expect_re = re.compile(r'\s* Expect:\s* ( .* ) ')
|
|
_data_expect_re = re.compile(r'entries\[0\]\[\'[^ \'] + \'\](?: \[...
|
|
_feed_data_expect_re = re.compile(r'feed\[\'[^ \'] + \'\]\s* ==\s* ...
|
_data_expect_re
- Value:
re.compile(r'entries\[0\]\[\'[^ \'] + \'\](?: \[0\]\[\'value\'\]) ? \s* ==\s*
( .* ) ')
|
|
_feed_data_expect_re
- Value:
re.compile(r'feed\[\'[^ \'] + \'\]\s* ==\s* ( .* ) ')
|
|