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

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

Issue 1143323006: Histograms.xml python script housekeeping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bad_message
Patch Set: Fix imports (sadface) Created 5 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
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 d95e259c4bb36b17197a19e140d879823997fb4d..a598439007d2cc7aac7df5c1414afb61afa1f5c7 100755
--- a/tools/metrics/histograms/update_use_counter_css.py
+++ b/tools/metrics/histograms/update_use_counter_css.py
@@ -15,13 +15,13 @@ import re
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
-from update_histogram_enum import ReadHistogramValues
-from update_histogram_enum import UpdateHistogramFromDict
-from update_use_counter_feature_enum import PrintEnumForDashboard
+import path_util
+import update_histogram_enum
+import update_use_counter_feature_enum
-USE_COUNTER_CPP_PATH = \
- '../../../third_party/WebKit/Source/core/frame/UseCounter.cpp'
+
+USE_COUNTER_CPP_PATH = 'third_party/WebKit/Source/core/frame/UseCounter.cpp'
def EnumToCssProperty(enum_name):
@@ -33,7 +33,7 @@ def EnumToCssProperty(enum_name):
def ReadCssProperties(filename):
# Read the file as a list of lines
- with open(filename) as f:
+ with open(path_util.GetInputFile(filename)) as f:
content = f.readlines()
# Looking for a line like "case CSSPropertyGrid: return 453;".
@@ -64,8 +64,8 @@ if __name__ == '__main__':
if options.dashboard:
enum_dict = ReadCssProperties(USE_COUNTER_CPP_PATH)
- PrintEnumForDashboard(enum_dict)
+ update_use_counter_feature_enum.PrintEnumForDashboard(enum_dict)
else:
- UpdateHistogramFromDict(
+ update_histogram_enum.UpdateHistogramFromDict(
'MappedCSSProperties', ReadCssProperties(USE_COUNTER_CPP_PATH),
USE_COUNTER_CPP_PATH)
« no previous file with comments | « tools/metrics/histograms/update_policies.py ('k') | tools/metrics/histograms/update_use_counter_feature_enum.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698