OLD | NEW |
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 Repackage expected/actual GM results as needed by our HTML rebaseline viewer. | 9 Repackage expected/actual GM results as needed by our HTML rebaseline viewer. |
10 """ | 10 """ |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 if builder_regex_list != None: | 82 if builder_regex_list != None: |
83 self.set_match_builders_pattern_list(builder_regex_list) | 83 self.set_match_builders_pattern_list(builder_regex_list) |
84 self._image_diff_db = imagediffdb.ImageDiffDB(generated_images_root) | 84 self._image_diff_db = imagediffdb.ImageDiffDB(generated_images_root) |
85 self._diff_base_url = ( | 85 self._diff_base_url = ( |
86 diff_base_url or | 86 diff_base_url or |
87 download_actuals.create_filepath_url(generated_images_root)) | 87 download_actuals.create_filepath_url(generated_images_root)) |
88 self._actuals_root = actuals_root | 88 self._actuals_root = actuals_root |
89 self._expected_root = expected_root | 89 self._expected_root = expected_root |
90 self._load_actual_and_expected() | 90 self._load_actual_and_expected() |
91 self._timestamp = int(time.time()) | 91 self._timestamp = int(time.time()) |
92 logging.info('Number of download file collisions: %s' % | |
93 imagediffdb.global_file_collisions) | |
94 logging.info('Results complete; took %d seconds.' % | 92 logging.info('Results complete; took %d seconds.' % |
95 (self._timestamp - time_start)) | 93 (self._timestamp - time_start)) |
96 | 94 |
97 def edit_expectations(self, modifications): | 95 def edit_expectations(self, modifications): |
98 """Edit the expectations stored within this object and write them back | 96 """Edit the expectations stored within this object and write them back |
99 to disk. | 97 to disk. |
100 | 98 |
101 Note that this will NOT update the results stored in self._results[] ; | 99 Note that this will NOT update the results stored in self._results[] ; |
102 in order to see those updates, you must instantiate a new | 100 in order to see those updates, you must instantiate a new |
103 ExpectationComparisons object based on the (now updated) files on disk. | 101 ExpectationComparisons object based on the (now updated) files on disk. |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 results_obj = ExpectationComparisons(actuals_root=args.actuals, | 366 results_obj = ExpectationComparisons(actuals_root=args.actuals, |
369 expected_root=args.expectations, | 367 expected_root=args.expectations, |
370 generated_images_root=args.workdir) | 368 generated_images_root=args.workdir) |
371 gm_json.WriteToFile( | 369 gm_json.WriteToFile( |
372 results_obj.get_packaged_results_of_type(results_type=args.results), | 370 results_obj.get_packaged_results_of_type(results_type=args.results), |
373 args.outfile) | 371 args.outfile) |
374 | 372 |
375 | 373 |
376 if __name__ == '__main__': | 374 if __name__ == '__main__': |
377 main() | 375 main() |
OLD | NEW |