| OLD | NEW |
| 1 # Copyright (c) 2009, Google Inc. All rights reserved. | 1 # Copyright (c) 2009, Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 import collections | 29 import collections |
| 30 import re | 30 import re |
| 31 import urllib2 | 31 import urllib2 |
| 32 | 32 |
| 33 from webkitpy.common.memoized import memoized | 33 from webkitpy.common.memoized import memoized |
| 34 from webkitpy.common.net.layouttestresults import LayoutTestResults | 34 from webkitpy.common.net.layout_test_results import LayoutTestResults |
| 35 from webkitpy.common.net.networktransaction import NetworkTransaction | 35 from webkitpy.common.net.network_transaction import NetworkTransaction |
| 36 | 36 |
| 37 | 37 |
| 38 RESULTS_URL_BASE = 'https://storage.googleapis.com/chromium-layout-test-archives
' | 38 RESULTS_URL_BASE = 'https://storage.googleapis.com/chromium-layout-test-archives
' |
| 39 | 39 |
| 40 | 40 |
| 41 class Build(collections.namedtuple('Build', ('builder_name', 'build_number'))): | 41 class Build(collections.namedtuple('Build', ('builder_name', 'build_number'))): |
| 42 """Represents a combination of builder and build number. | 42 """Represents a combination of builder and build number. |
| 43 | 43 |
| 44 If build number is None, this represents the latest build | 44 If build number is None, this represents the latest build |
| 45 for a given builder. | 45 for a given builder. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 def _fetch_file(self, url_base, file_name): | 114 def _fetch_file(self, url_base, file_name): |
| 115 # It seems this can return None if the url redirects and then returns 40
4. | 115 # It seems this can return None if the url redirects and then returns 40
4. |
| 116 # FIXME: This could use Web instead of using urllib2 directly. | 116 # FIXME: This could use Web instead of using urllib2 directly. |
| 117 result = urllib2.urlopen("%s/%s" % (url_base, file_name)) | 117 result = urllib2.urlopen("%s/%s" % (url_base, file_name)) |
| 118 if not result: | 118 if not result: |
| 119 return None | 119 return None |
| 120 # urlopen returns a file-like object which sometimes works fine with str
() | 120 # urlopen returns a file-like object which sometimes works fine with str
() |
| 121 # but sometimes is a addinfourl object. In either case calling read() i
s correct. | 121 # but sometimes is a addinfourl object. In either case calling read() i
s correct. |
| 122 return result.read() | 122 return result.read() |
| OLD | NEW |