Changes between Version 1 and Version 2 of GenshiRecipes/WerkzeugWithGenshi
- Timestamp:
- Jul 15, 2008, 10:38:25 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenshiRecipes/WerkzeugWithGenshi
v1 v2 9 9 {{{ 10 10 #!python 11 from werkzeug import Response as BaseResponse11 from werkzeug import Response as ResponseBase 12 12 13 13 TEMPLATES_DIR = # some path 14 14 15 class Response( BaseResponse):15 class Response(ResponseBase): 16 16 """Subclass of base responses that has a default mimetype of text/html.""" 17 17 default_mimetype = "text/html" 18 18 19 19 20 class TemplatedResponse(Response): … … 27 28 self.template = self.loader.load(template) 28 29 self.stream = self.template.generate(data=data) 29 self.response = self.stream.render('xhtml', doctype=DocType.XHTML_STRICT) 30 31 Response.__init__(self, self.response) 30 response = self.stream.render('xhtml', doctype=DocType.XHTML_STRICT) 31 Response.__init__(self, response) 32 32 }}} 33 33