Mercurial > genshi > mirror
changeset 863:869ca3cc2f4c trunk
Make the output tests skip the encoding step.
author | cmlenz |
---|---|
date | Thu, 12 Nov 2009 21:01:08 +0000 |
parents | f4543bebe41b |
children | f91289c7d092 |
files | genshi/output.py |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/genshi/output.py +++ b/genshi/output.py @@ -26,6 +26,7 @@ 'XHTMLSerializer', 'HTMLSerializer', 'TextSerializer'] __docformat__ = 'restructuredtext en' + def encode(iterator, method='xml', encoding='utf-8', out=None): """Encode serializer output into a string. @@ -57,6 +58,7 @@ for chunk in iterator: out.write(_encode(chunk)) + def get_serializer(method='xml', **kwargs): """Return a serializer object for the given method. @@ -542,14 +544,15 @@ that markup is by default passed through unchanged: >>> elem = tag.div(Markup('<a href="foo">Hello & Bye!</a><br/>')) - >>> print(elem.generate().render(TextSerializer)) + >>> print(elem.generate().render(TextSerializer, encoding=None)) <a href="foo">Hello & Bye!</a><br/> You can use the ``strip_markup`` to change this behavior, so that tags and entities are stripped from the output (or in the case of entities, replaced with the equivalent character): - >>> print(elem.generate().render(TextSerializer, strip_markup=True)) + >>> print(elem.generate().render(TextSerializer, strip_markup=True, + ... encoding=None)) Hello & Bye! """