Using a decorator for generic html templates

Carlos Ribeiro carribeiro at
Thu Sep 16 00:16:12 CEST 2004

Hello all again,

I made a small mistake in my previous post. Please change one line only:

-        return func.__doc__
+         return trim(func.__doc__)

The resulting test run is now correct: 

>>> r = Root()
>>> r.index()
'<html>\n  <body>\n    <h1>Hello World!</h1>\n  </body>\n</html>'

As you can see, I just forgot to call trim() at the right time when
crafting my example. Sorry for the inconvenience.

Carlos Ribeiro
Consultoria em Projetos
mail: carribeiro at
mail: carribeiro at

More information about the Python-list mailing list