/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/apps/branch.py

  • Committer: Michael Hudson
  • Date: 2008-06-25 06:18:13 UTC
  • mfrom: (174.1.8 streaming)
  • Revision ID: michael.hudson@canonical.com-20080625061813-3cr5iax8sdz0e67s
merge my streaming branch which:
 * most importantly, streams the pages as they render to the client, which 
   reduces memory usage on large pages and feels better for the user
 * makes the stuff in controller/ have a more wsgi-ish interface
 * restores the stripping of excess whitespace from the output

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
from paste import request
5
5
from paste import httpexceptions
6
 
from paste.wsgiwrappers import WSGIRequest, WSGIResponse
7
6
 
8
7
from loggerhead.apps import static_app
9
8
 
83
82
        return self.history.get_config().get_user_option('public_branch')
84
83
 
85
84
    def app(self, environ, start_response):
86
 
        req = WSGIRequest(environ)
87
 
        response = WSGIResponse()
88
 
        response.headers['Content-Type'] = 'text/plain'
89
85
        self._url_base = environ['SCRIPT_NAME']
90
86
        self._static_url_base = environ.get('loggerhead.static.url')
91
87
        if self._static_url_base is None:
101
97
        if cls is None:
102
98
            raise httpexceptions.HTTPNotFound()
103
99
        c = cls(self)
104
 
        c.default(req, response)
105
 
        return response(environ, start_response)
 
100
        return c(environ, start_response)