Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import cgi | 6 import cgi |
| 7 import logging | 7 import logging |
| 8 import re | 8 import re |
| 9 import os | 9 import os |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 logging.info("Cache miss: " + path) | 65 logging.info("Cache miss: " + path) |
| 66 url = self.getSrcUrl(path) | 66 url = self.getSrcUrl(path) |
| 67 if (url[1] is not Channel.TRUNK) and (url[0] != "http://src.chromium.org/f avicon.ico"): | 67 if (url[1] is not Channel.TRUNK) and (url[0] != "http://src.chromium.org/f avicon.ico"): |
| 68 branch = self.getBranch(url[1]) | 68 branch = self.getBranch(url[1]) |
| 69 url = url[0] % branch | 69 url = url[0] % branch |
| 70 else: | 70 else: |
| 71 url = url[0] | 71 url = url[0] |
| 72 logging.info("Path: " + self.request.path) | 72 logging.info("Path: " + self.request.path) |
| 73 logging.info("Url: " + url) | 73 logging.info("Url: " + url) |
| 74 try: | 74 try: |
| 75 result = urlfetch.fetch(url + self.request.query_string) | 75 # TODO(aa): Do we need to pass the querystring through here? We used to, |
|
Mihai Parparita -not on Chrome
2011/11/15 14:44:49
You could also switch this to url + '?' + self.req
Aaron Boodman
2011/11/15 19:06:57
Aha! In that case, I'm comfortable just removing t
| |
| 76 # but that caused problems. See crbug.com/104272. | |
| 77 result = urlfetch.fetch(url) | |
| 76 if result.status_code != 200: | 78 if result.status_code != 200: |
| 77 logging.error("urlfetch failed: " + url) | 79 logging.error("urlfetch failed: " + url) |
| 78 # TODO(nickbaum): what should we do when the urlfetch fails? | 80 # TODO(nickbaum): what should we do when the urlfetch fails? |
| 79 except: | 81 except: |
| 80 logging.error("urlfetch failed: " + url) | 82 logging.error("urlfetch failed: " + url) |
| 81 # TODO(nickbaum): what should we do when the urlfetch fails? | 83 # TODO(nickbaum): what should we do when the urlfetch fails? |
| 82 try: | 84 try: |
| 83 if not memcache.add(path, result, DEFAULT_CACHE_TIME): | 85 if not memcache.add(path, result, DEFAULT_CACHE_TIME): |
| 84 logging.error("Memcache set failed.") | 86 logging.error("Memcache set failed.") |
| 85 except: | 87 except: |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 ('/.*', MainPage), | 267 ('/.*', MainPage), |
| 266 ], debug=False) | 268 ], debug=False) |
| 267 | 269 |
| 268 | 270 |
| 269 def main(): | 271 def main(): |
| 270 run_wsgi_app(application) | 272 run_wsgi_app(application) |
| 271 | 273 |
| 272 | 274 |
| 273 if __name__ == '__main__': | 275 if __name__ == '__main__': |
| 274 main() | 276 main() |
| OLD | NEW |