[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/renderer/rest.py added optional parameter to the render method to allow overriding of the

Christian Theune ct at gocept.com
Thu Jan 11 04:51:23 EST 2007


Hi,

can you please make a note in the changelog?

Christian

Am Mittwoch, den 10.01.2007, 05:17 -0500 schrieb Jodok Batlogg:
> Log message for revision 71853:
>   added optional parameter to the render method to allow overriding of the 
>   default settings for rendering rest files.
>   right now render returns html that includes two times H1 which doesn't
>   fit for a lot of use-cases
>   
> 
> Changed:
>   U   Zope3/trunk/src/zope/app/renderer/rest.py
> 
> -=-
> Modified: Zope3/trunk/src/zope/app/renderer/rest.py
> ===================================================================
> --- Zope3/trunk/src/zope/app/renderer/rest.py	2007-01-10 09:37:44 UTC (rev 71852)
> +++ Zope3/trunk/src/zope/app/renderer/rest.py	2007-01-10 10:16:55 UTC (rev 71853)
> @@ -86,7 +86,7 @@
>      implements(IHTMLRenderer)
>      __used_for__ = IReStructuredTextSource
>  
> -    def render(self):
> +    def render(self, settings_overrides=None):
>          r"""See zope.app.interfaces.renderer.IHTMLRenderer
>  
>          Let's make sure that inputted unicode stays as unicode:
> @@ -95,12 +95,15 @@
>          >>> renderer.render()
>          u'<p>b\xc3h</p>\n'
>          """
> -        settings_overrides = {
> -            'halt_level': 6,
> -            'input_encoding': 'unicode',
> -            'output_encoding': 'unicode',
> -            'initial_header_level': 3
> -            }
> +        if settings_overrides is None:
> +            # default settings for the renderer
> +            settings_overrides = {
> +                'halt_level': 6,
> +                'input_encoding': 'unicode',
> +                'output_encoding': 'unicode',
> +                'initial_header_level': 3,
> +                }
> +
>          writer = Writer()
>          writer.translator_class = ZopeTranslator
>          html = docutils.core.publish_string(
> 
> _______________________________________________
> Zope3-Checkins mailing list
> Zope3-Checkins at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-checkins
-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.zope.org/pipermail/zope3-checkins/attachments/20070111/e468c7df/attachment.bin


More information about the Zope3-Checkins mailing list