Chromium Code Reviews| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 KEY__EXTRACOLUMN__CONFIG = 'config' | 45 KEY__EXTRACOLUMN__CONFIG = 'config' |
| 46 KEY__EXTRACOLUMN__RESULT_TYPE = 'resultType' | 46 KEY__EXTRACOLUMN__RESULT_TYPE = 'resultType' |
| 47 KEY__EXTRACOLUMN__TEST = 'test' | 47 KEY__EXTRACOLUMN__TEST = 'test' |
| 48 KEY__HEADER = 'header' | 48 KEY__HEADER = 'header' |
| 49 KEY__HEADER__DATAHASH = 'dataHash' | 49 KEY__HEADER__DATAHASH = 'dataHash' |
| 50 KEY__HEADER__IS_EDITABLE = 'isEditable' | 50 KEY__HEADER__IS_EDITABLE = 'isEditable' |
| 51 KEY__HEADER__IS_EXPORTED = 'isExported' | 51 KEY__HEADER__IS_EXPORTED = 'isExported' |
| 52 KEY__HEADER__IS_STILL_LOADING = 'resultsStillLoading' | 52 KEY__HEADER__IS_STILL_LOADING = 'resultsStillLoading' |
| 53 KEY__HEADER__RESULTS_ALL = 'all' | 53 KEY__HEADER__RESULTS_ALL = 'all' |
| 54 KEY__HEADER__RESULTS_FAILURES = 'failures' | 54 KEY__HEADER__RESULTS_FAILURES = 'failures' |
| 55 KEY__HEADER__SCHEMA_VERSION = 'schemaVersion' | |
| 56 KEY__HEADER__SCHEMA_VERSION_CURRENT = 1 | |
|
rmistry
2014/03/13 16:13:43
Can we create a separate constant for the version
epoger
2014/03/13 16:32:44
You mean just because they are named KEY__* you th
| |
| 55 KEY__HEADER__TIME_NEXT_UPDATE_AVAILABLE = 'timeNextUpdateAvailable' | 57 KEY__HEADER__TIME_NEXT_UPDATE_AVAILABLE = 'timeNextUpdateAvailable' |
| 56 KEY__HEADER__TIME_UPDATED = 'timeUpdated' | 58 KEY__HEADER__TIME_UPDATED = 'timeUpdated' |
| 57 KEY__HEADER__TYPE = 'type' | 59 KEY__HEADER__TYPE = 'type' |
| 58 KEY__NEW_IMAGE_URL = 'newImageUrl' | 60 KEY__NEW_IMAGE_URL = 'newImageUrl' |
| 59 KEY__RESULT_TYPE__FAILED = gm_json.JSONKEY_ACTUALRESULTS_FAILED | 61 KEY__RESULT_TYPE__FAILED = gm_json.JSONKEY_ACTUALRESULTS_FAILED |
| 60 KEY__RESULT_TYPE__FAILUREIGNORED = gm_json.JSONKEY_ACTUALRESULTS_FAILUREIGNORED | 62 KEY__RESULT_TYPE__FAILUREIGNORED = gm_json.JSONKEY_ACTUALRESULTS_FAILUREIGNORED |
| 61 KEY__RESULT_TYPE__NOCOMPARISON = gm_json.JSONKEY_ACTUALRESULTS_NOCOMPARISON | 63 KEY__RESULT_TYPE__NOCOMPARISON = gm_json.JSONKEY_ACTUALRESULTS_NOCOMPARISON |
| 62 KEY__RESULT_TYPE__SUCCEEDED = gm_json.JSONKEY_ACTUALRESULTS_SUCCEEDED | 64 KEY__RESULT_TYPE__SUCCEEDED = gm_json.JSONKEY_ACTUALRESULTS_SUCCEEDED |
| 63 | 65 |
| 64 EXPECTATION_FIELDS_PASSED_THRU_VERBATIM = [ | 66 EXPECTATION_FIELDS_PASSED_THRU_VERBATIM = [ |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 must be one of the RESULTS_* constants | 188 must be one of the RESULTS_* constants |
| 187 reload_seconds: if specified, note that new results may be available once | 189 reload_seconds: if specified, note that new results may be available once |
| 188 these results are reload_seconds old | 190 these results are reload_seconds old |
| 189 is_editable: whether clients are allowed to submit new baselines | 191 is_editable: whether clients are allowed to submit new baselines |
| 190 is_exported: whether these results are being made available to other | 192 is_exported: whether these results are being made available to other |
| 191 network hosts | 193 network hosts |
| 192 """ | 194 """ |
| 193 response_dict = self._results[results_type] | 195 response_dict = self._results[results_type] |
| 194 time_updated = self.get_timestamp() | 196 time_updated = self.get_timestamp() |
| 195 response_dict[KEY__HEADER] = { | 197 response_dict[KEY__HEADER] = { |
| 198 KEY__HEADER__SCHEMA_VERSION: KEY__HEADER__SCHEMA_VERSION_CURRENT, | |
| 199 | |
| 196 # Timestamps: | 200 # Timestamps: |
| 197 # 1. when this data was last updated | 201 # 1. when this data was last updated |
| 198 # 2. when the caller should check back for new data (if ever) | 202 # 2. when the caller should check back for new data (if ever) |
| 199 KEY__HEADER__TIME_UPDATED: time_updated, | 203 KEY__HEADER__TIME_UPDATED: time_updated, |
| 200 KEY__HEADER__TIME_NEXT_UPDATE_AVAILABLE: ( | 204 KEY__HEADER__TIME_NEXT_UPDATE_AVAILABLE: ( |
| 201 (time_updated+reload_seconds) if reload_seconds else None), | 205 (time_updated+reload_seconds) if reload_seconds else None), |
| 202 | 206 |
| 203 # The type we passed to get_results_of_type() | 207 # The type we passed to get_results_of_type() |
| 204 KEY__HEADER__TYPE: results_type, | 208 KEY__HEADER__TYPE: results_type, |
| 205 | 209 |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 492 results = Results(actuals_root=args.actuals, | 496 results = Results(actuals_root=args.actuals, |
| 493 expected_root=args.expectations, | 497 expected_root=args.expectations, |
| 494 generated_images_root=args.workdir) | 498 generated_images_root=args.workdir) |
| 495 gm_json.WriteToFile( | 499 gm_json.WriteToFile( |
| 496 results.get_packaged_results_of_type(results_type=args.results), | 500 results.get_packaged_results_of_type(results_type=args.results), |
| 497 args.outfile) | 501 args.outfile) |
| 498 | 502 |
| 499 | 503 |
| 500 if __name__ == '__main__': | 504 if __name__ == '__main__': |
| 501 main() | 505 main() |
| OLD | NEW |