Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

20 Zeilen
604 B

  1. #!/usr/bin/python
  2. # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*-
  3. from decorators import WSGITemplate # decoratore ( singleton )
  4. wsgitmpl = WSGITemplate()
  5. #
  6. # esempio minimo di controller WSGI
  7. #
  8. @wsgitmpl.template( 'template1.tmpl' )
  9. def application( environ, start_response ):
  10. from pprint import pformat
  11. html = environ['template']( context=dict( v1=1, v2='pippo') )
  12. start_response( '200 OK', [('content-type', 'text/html; charset=utf-8')] )
  13. return [ html, pformat( environ, width=132 ).replace('\n','<br>\n') ] # TODO: pformat..... ---> trasformarlo in un decoratore