OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 """ | 3 """ |
4 Copyright 2014 Google Inc. | 4 Copyright 2014 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 Compare results of two render_pictures runs. | 9 Compare results of two render_pictures runs. |
10 | 10 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 Returns: | 392 Returns: |
393 An ImagePair object, or None if both image_dict_A and image_dict_B are | 393 An ImagePair object, or None if both image_dict_A and image_dict_B are |
394 None. | 394 None. |
395 """ | 395 """ |
396 if (not image_dict_A) and (not image_dict_B): | 396 if (not image_dict_A) and (not image_dict_B): |
397 return None | 397 return None |
398 | 398 |
399 def _checksum_and_relative_url(dic): | 399 def _checksum_and_relative_url(dic): |
400 if dic: | 400 if dic: |
401 return ((dic[gm_json.JSONKEY_IMAGE_CHECKSUMALGORITHM], | 401 return ((dic[gm_json.JSONKEY_IMAGE_CHECKSUMALGORITHM], |
402 dic[gm_json.JSONKEY_IMAGE_CHECKSUMVALUE]), | 402 int(dic[gm_json.JSONKEY_IMAGE_CHECKSUMVALUE])), |
403 dic[gm_json.JSONKEY_IMAGE_FILEPATH]) | 403 dic[gm_json.JSONKEY_IMAGE_FILEPATH]) |
404 else: | 404 else: |
405 return None, None | 405 return None, None |
406 | 406 |
407 imageA_checksum, imageA_relative_url = _checksum_and_relative_url( | 407 imageA_checksum, imageA_relative_url = _checksum_and_relative_url( |
408 image_dict_A) | 408 image_dict_A) |
409 imageB_checksum, imageB_relative_url = _checksum_and_relative_url( | 409 imageB_checksum, imageB_relative_url = _checksum_and_relative_url( |
410 image_dict_B) | 410 image_dict_B) |
411 | 411 |
412 if not imageA_checksum: | 412 if not imageA_checksum: |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 source_dir: path to source dir (GS URL, local filepath, or a special | 479 source_dir: path to source dir (GS URL, local filepath, or a special |
480 "repo:" URL type that points at a file within our Skia checkout; | 480 "repo:" URL type that points at a file within our Skia checkout; |
481 only the "repo:" URL type will have a commit hash. | 481 only the "repo:" URL type will have a commit hash. |
482 """ | 482 """ |
483 if source_dir.lower().startswith(REPO_URL_PREFIX): | 483 if source_dir.lower().startswith(REPO_URL_PREFIX): |
484 repo_dir = os.path.join(REPO_BASEPATH, source_dir[len(REPO_URL_PREFIX):]) | 484 repo_dir = os.path.join(REPO_BASEPATH, source_dir[len(REPO_URL_PREFIX):]) |
485 return subprocess.check_output( | 485 return subprocess.check_output( |
486 args=[git_utils.GIT, 'rev-parse', 'HEAD'], cwd=repo_dir).strip() | 486 args=[git_utils.GIT, 'rev-parse', 'HEAD'], cwd=repo_dir).strip() |
487 else: | 487 else: |
488 return None | 488 return None |
OLD | NEW |