Edgewall Software

Changes between Version 1 and Version 2 of GenshiRecipes/WerkzeugWithGenshi


Ignore:
Timestamp:
Jul 15, 2008, 10:38:25 PM (16 years ago)
Author:
mitsuhiko
Comment:

mitsuhiko approved it

Legend:

Unmodified
Added
Removed
Modified
  • GenshiRecipes/WerkzeugWithGenshi

    v1 v2  
    99{{{
    1010#!python
    11 from werkzeug import Response as BaseResponse
     11from werkzeug import Response as ResponseBase
    1212
    1313TEMPLATES_DIR = # some path
    1414
    15 class Response(BaseResponse):
     15class Response(ResponseBase):
    1616    """Subclass of base responses that has a default mimetype of text/html."""
    1717    default_mimetype = "text/html"
     18
    1819
    1920class TemplatedResponse(Response):
     
    2728        self.template = self.loader.load(template)
    2829        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)
    3232}}}
    3333