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

Unified Diff: tools/metrics/histograms/update_use_counter_css.py

Issue 2554263002: CSS Motion Path: Use counter for offset-rotate (Closed)
Patch Set: tests Created 4 years 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 | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/histograms/update_use_counter_css.py
diff --git a/tools/metrics/histograms/update_use_counter_css.py b/tools/metrics/histograms/update_use_counter_css.py
index a598439007d2cc7aac7df5c1414afb61afa1f5c7..a4dd2865eddb93de066c3bdca4c3928d8d4e920d 100755
--- a/tools/metrics/histograms/update_use_counter_css.py
+++ b/tools/metrics/histograms/update_use_counter_css.py
@@ -36,19 +36,23 @@ def ReadCssProperties(filename):
with open(path_util.GetInputFile(filename)) as f:
content = f.readlines()
- # Looking for a line like "case CSSPropertyGrid: return 453;".
+ # Looking for a pair of lines like "case CSSPropertyGrid:\n return 453;".
ENUM_REGEX = re.compile(r"""CSSProperty(.*): # capture the enum name
\s*return\s*
([0-9]+) # capture the id
""", re.VERBOSE)
properties = {}
+ previous_line = ''
for line in content:
- enum_match = ENUM_REGEX.search(line)
+ enum_match = ENUM_REGEX.search(previous_line + '\n' + line)
if enum_match:
enum_name = enum_match.group(1)
property_id = int(enum_match.group(2))
properties[property_id] = EnumToCssProperty(enum_name)
+ previous_line = ''
+ else:
+ previous_line = line
Ilya Sherman 2016/12/08 04:52:33 Hmm, odd. Did the structure of the file recently
Eric Willigers 2016/12/08 05:03:56 clang-format was run across Blink on Sep 30: 1c8e1
Ilya Sherman 2016/12/08 05:04:33 Okay, that makes sense. Thanks!
return properties
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698