~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/apps/transport.py

  • Committer: Michael Hudson
  • Date: 2009-06-25 01:49:39 UTC
  • mto: This revision was merged to the branch mainline in revision 373.
  • Revision ID: michael.hudson@canonical.com-20090625014939-30dbayotedij14vh
may as well delay getting a transport a bit

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
        self._config = config
144
144
 
145
145
    def __call__(self, environ, start_response):
146
 
        transport = get_transport_for_thread(self.base)
147
146
        environ['loggerhead.static.url'] = environ['SCRIPT_NAME']
148
147
        if environ['PATH_INFO'].startswith('/static/'):
149
148
            segment = path_info_pop(environ)
152
151
        elif environ['PATH_INFO'] == '/favicon.ico':
153
152
            return favicon_app(environ, start_response)
154
153
        else:
 
154
            transport = get_transport_for_thread(self.base)
155
155
            return BranchesFromTransportServer(
156
156
                transport, self)(environ, start_response)
157
157
 
167
167
    def __call__(self, environ, start_response):
168
168
        environ['loggerhead.static.url'] = environ['SCRIPT_NAME']
169
169
        path_info = environ['PATH_INFO']
170
 
        transport = get_transport_for_thread(self.base)
171
170
        if path_info.startswith('/static/'):
172
171
            segment = path_info_pop(environ)
173
172
            assert segment == 'static'
175
174
        elif path_info == '/favicon.ico':
176
175
            return favicon_app(environ, start_response)
177
176
        else:
 
177
            transport = get_transport_for_thread(self.base)
178
178
            # segments starting with ~ are user branches
179
179
            if path_info.startswith('/~'):
180
180
                segment = path_info_pop(environ)