Show More
@@ -210,12 +210,10 b' class RequestScopeProxyFactory(object):' | |||||
210 | request = request or get_current_request() |
|
210 | request = request or get_current_request() | |
211 | return self.getProxy(request) |
|
211 | return self.getProxy(request) | |
212 |
|
212 | |||
213 |
def getProxy(self, request |
|
213 | def getProxy(self, request): | |
214 | """ |
|
214 | """ | |
215 | Call this to get the pyro proxy instance for the request. |
|
215 | Call this to get the pyro proxy instance for the request. | |
216 | """ |
|
216 | """ | |
217 | request = request or get_current_request() |
|
|||
218 |
|
||||
219 | # Return already borrowed proxy for this request |
|
217 | # Return already borrowed proxy for this request | |
220 | if request in self._borrowed_proxies: |
|
218 | if request in self._borrowed_proxies: | |
221 | return self._borrowed_proxies[request] |
|
219 | return self._borrowed_proxies[request] | |
@@ -233,13 +231,11 b' class RequestScopeProxyFactory(object):' | |||||
233 |
|
231 | |||
234 | return proxy |
|
232 | return proxy | |
235 |
|
233 | |||
236 |
def _returnProxy(self, request |
|
234 | def _returnProxy(self, request): | |
237 | """ |
|
235 | """ | |
238 | Callback that gets called by pyramid when the request is finished. |
|
236 | Callback that gets called by pyramid when the request is finished. | |
239 | It puts the proxy back into the pool. |
|
237 | It puts the proxy back into the pool. | |
240 | """ |
|
238 | """ | |
241 | request = request or get_current_request() |
|
|||
242 |
|
||||
243 | if request in self._borrowed_proxies: |
|
239 | if request in self._borrowed_proxies: | |
244 | proxy = self._borrowed_proxies.pop(request) |
|
240 | proxy = self._borrowed_proxies.pop(request) | |
245 | self._proxy_pool.append(proxy) |
|
241 | self._proxy_pool.append(proxy) |
General Comments 0
You need to be logged in to leave comments.
Login now