Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: gm/rebaseline_server/imagediffdb.py

Issue 115863003: rebaseline_server: stop catching KeyboardInterrupt (ctrl-C) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 """ 3 """
4 Copyright 2013 Google Inc. 4 Copyright 2013 Google Inc.
5 5
6 Use of this source code is governed by a BSD-style license that can be 6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file. 7 found in the LICENSE file.
8 8
9 Calulate differences between image pairs, and store them in a database. 9 Calulate differences between image pairs, and store them in a database.
10 """ 10 """
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 """ 167 """
168 key = (expected_image_locator, actual_image_locator) 168 key = (expected_image_locator, actual_image_locator)
169 if not key in self._diff_dict: 169 if not key in self._diff_dict:
170 try: 170 try:
171 new_diff_record = DiffRecord( 171 new_diff_record = DiffRecord(
172 self._storage_root, 172 self._storage_root,
173 expected_image_url=expected_image_url, 173 expected_image_url=expected_image_url,
174 expected_image_locator=expected_image_locator, 174 expected_image_locator=expected_image_locator,
175 actual_image_url=actual_image_url, 175 actual_image_url=actual_image_url,
176 actual_image_locator=actual_image_locator) 176 actual_image_locator=actual_image_locator)
177 except: 177 except Exception:
178 logging.exception('got exception while creating new DiffRecord') 178 logging.exception('got exception while creating new DiffRecord')
179 return 179 return
180 self._diff_dict[key] = new_diff_record 180 self._diff_dict[key] = new_diff_record
181 181
182 def get_diff_record(self, expected_image_locator, actual_image_locator): 182 def get_diff_record(self, expected_image_locator, actual_image_locator):
183 """Returns the DiffRecord for this image pair. 183 """Returns the DiffRecord for this image pair.
184 184
185 Raises a KeyError if we don't have a DiffRecord for this image pair. 185 Raises a KeyError if we don't have a DiffRecord for this image pair.
186 """ 186 """
187 key = (expected_image_locator, actual_image_locator) 187 key = (expected_image_locator, actual_image_locator)
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 and actual_image. 318 and actual_image.
319 319
320 Args: 320 Args:
321 expected_image_locator: locator string pointing at expected image 321 expected_image_locator: locator string pointing at expected image
322 actual_image_locator: locator string pointing at actual image 322 actual_image_locator: locator string pointing at actual image
323 323
324 Returns: locator where the diffs between expected and actual images can be 324 Returns: locator where the diffs between expected and actual images can be
325 found 325 found
326 """ 326 """
327 return "%s-vs-%s" % (expected_image_locator, actual_image_locator) 327 return "%s-vs-%s" % (expected_image_locator, actual_image_locator)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698