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

Unified Diff: gm/rebaseline_server/column.py

Issue 270413002: rebaseline_server JSON: pass category values as values, not keys (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gm/rebaseline_server/compare_to_expectations.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/column.py
diff --git a/gm/rebaseline_server/column.py b/gm/rebaseline_server/column.py
index d8d119d1304f74b43c35c5e865863f7d1ccef958..26597c37d54b0de9ee55cf41b0f3a5c03e107eb9 100644
--- a/gm/rebaseline_server/column.py
+++ b/gm/rebaseline_server/column.py
@@ -11,11 +11,12 @@ ColumnHeaderFactory class (see class docstring for details)
# Keys used within dictionary representation of each column header.
# NOTE: Keep these in sync with static/constants.js
-KEY__HEADER_TEXT = 'headerText'
-KEY__HEADER_URL = 'headerUrl'
-KEY__IS_FILTERABLE = 'isFilterable'
-KEY__IS_SORTABLE = 'isSortable'
-KEY__VALUES_AND_COUNTS = 'valuesAndCounts'
+KEY__EXTRACOLUMNHEADERS = 'extraColumnHeaders'
+KEY__EXTRACOLUMNHEADERS__HEADER_TEXT = 'headerText'
+KEY__EXTRACOLUMNHEADERS__HEADER_URL = 'headerUrl'
+KEY__EXTRACOLUMNHEADERS__IS_FILTERABLE = 'isFilterable'
+KEY__EXTRACOLUMNHEADERS__IS_SORTABLE = 'isSortable'
+KEY__EXTRACOLUMNHEADERS__VALUES_AND_COUNTS = 'valuesAndCounts'
class ColumnHeaderFactory(object):
@@ -46,7 +47,8 @@ class ColumnHeaderFactory(object):
"""Creates the header for this column, in dictionary form.
Creates the header for this column in dictionary form, as needed when
- constructing the JSON representation. Uses the KEY__* constants as keys.
+ constructing the JSON representation. Uses the KEY__EXTRACOLUMNHEADERS__*
+ constants as keys.
Args:
values_and_counts_dict: dictionary mapping each possible column value
@@ -54,12 +56,13 @@ class ColumnHeaderFactory(object):
None if this information is not available.
"""
asdict = {
- KEY__HEADER_TEXT: self._header_text,
- KEY__IS_FILTERABLE: self._is_filterable,
- KEY__IS_SORTABLE: self._is_sortable,
+ KEY__EXTRACOLUMNHEADERS__HEADER_TEXT: self._header_text,
+ KEY__EXTRACOLUMNHEADERS__IS_FILTERABLE: self._is_filterable,
+ KEY__EXTRACOLUMNHEADERS__IS_SORTABLE: self._is_sortable,
}
if self._header_url:
- asdict[KEY__HEADER_URL] = self._header_url
+ asdict[KEY__EXTRACOLUMNHEADERS__HEADER_URL] = self._header_url
if self._include_values_and_counts and values_and_counts_dict:
- asdict[KEY__VALUES_AND_COUNTS] = values_and_counts_dict
+ asdict[KEY__EXTRACOLUMNHEADERS__VALUES_AND_COUNTS] = sorted(
+ values_and_counts_dict.items())
return asdict
« no previous file with comments | « no previous file | gm/rebaseline_server/compare_to_expectations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698