Chromium Code Reviews| Index: gm/rebaseline_server/imagepair.py |
| diff --git a/gm/rebaseline_server/imagepair.py b/gm/rebaseline_server/imagepair.py |
| index 1c71bd989caf436c097af45ac2237744d81916af..03b142a60a4bbe51daf9e1914fcc64daa6a6e8ca 100644 |
| --- a/gm/rebaseline_server/imagepair.py |
| +++ b/gm/rebaseline_server/imagepair.py |
| @@ -12,12 +12,12 @@ ImagePair class (see class docstring for details) |
| import posixpath |
| # Keys used within ImagePair dictionary representations. |
| -KEY_DIFFERENCE_DATA = 'differenceData' |
| -KEY_EXPECTATIONS_DATA = 'expectationsData' |
| -KEY_EXTRA_COLUMN_VALUES = 'extraColumnValues' |
| -KEY_IMAGE_A_URL = 'imageAUrl' |
| -KEY_IMAGE_B_URL = 'imageBUrl' |
| -KEY_IS_DIFFERENT = 'isDifferent' |
| +KEY__DIFFERENCE_DATA = 'differenceData' |
| +KEY__EXPECTATIONS_DATA = 'expectations' |
|
epoger
2014/02/11 06:15:40
I started using two underscores to delineate betwe
rmistry
2014/02/12 19:23:56
Sorry I do not follow, single underscores within w
epoger
2014/02/12 19:59:16
I mean, so it's clear that this should be parsed a
rmistry
2014/02/13 12:10:02
Thanks for the explanation.
|
| +KEY__EXTRA_COLUMN_VALUES = 'extraColumns' |
| +KEY__IMAGE_A_URL = 'imageAUrl' |
| +KEY__IMAGE_B_URL = 'imageBUrl' |
| +KEY__IS_DIFFERENT = 'isDifferent' |
| class ImagePair(object): |
| @@ -65,19 +65,19 @@ class ImagePair(object): |
| def as_dict(self): |
| """ |
| Return a dictionary describing this ImagePair, as needed when constructing |
| - the JSON representation. Uses the KEY_* constants as keys. |
| + the JSON representation. Uses the KEY__* constants as keys. |
| """ |
| asdict = { |
| - KEY_IMAGE_A_URL: self.imageA_relative_url, |
| - KEY_IMAGE_B_URL: self.imageB_relative_url, |
| + KEY__IMAGE_A_URL: self.imageA_relative_url, |
| + KEY__IMAGE_B_URL: self.imageB_relative_url, |
| } |
| if self.expectations_dict: |
| - asdict[KEY_EXPECTATIONS_DATA] = self.expectations_dict |
| + asdict[KEY__EXPECTATIONS_DATA] = self.expectations_dict |
| if self.extra_columns_dict: |
| - asdict[KEY_EXTRA_COLUMN_VALUES] = self.extra_columns_dict |
| + asdict[KEY__EXTRA_COLUMN_VALUES] = self.extra_columns_dict |
| if self.diff_record and (self.diff_record.get_num_pixels_differing() > 0): |
| - asdict[KEY_IS_DIFFERENT] = True |
| - asdict[KEY_DIFFERENCE_DATA] = self.diff_record.as_dict() |
| + asdict[KEY__IS_DIFFERENT] = True |
| + asdict[KEY__DIFFERENCE_DATA] = self.diff_record.as_dict() |
| else: |
| - asdict[KEY_IS_DIFFERENT] = False |
| + asdict[KEY__IS_DIFFERENT] = False |
| return asdict |