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

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

Issue 1143323006: Histograms.xml python script housekeeping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bad_message
Patch Set: Split off the extensions permission weirdness. 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_net_error_codes.py
diff --git a/tools/metrics/histograms/update_net_error_codes.py b/tools/metrics/histograms/update_net_error_codes.py
index 3659dd1afccfc7ad61b70a738ae0ad4359795592..7d40ac23180ce70a76c0fa8d4791f53e2c2d8d49 100755
--- a/tools/metrics/histograms/update_net_error_codes.py
+++ b/tools/metrics/histograms/update_net_error_codes.py
@@ -13,10 +13,10 @@ import os.path
import re
import sys
-sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
-from update_histogram_enum import UpdateHistogramFromDict
+import histograms_path
+import update_histogram_enum
-NET_ERROR_LIST_PATH = '../../../net/base/net_error_list.h'
+NET_ERROR_LIST_PATH = 'net/base/net_error_list.h'
POSITIVE_ERROR_REGEX = re.compile(r'^NET_ERROR\(([\w]+), -([0-9]+)\)')
NEGATIVE_ERROR_REGEX = re.compile(r'^NET_ERROR\(([\w]+), (-[0-9]+)\)')
@@ -26,7 +26,7 @@ def ReadNetErrorCodes(filename, error_regex):
error code to error name.
"""
# Read the file as a list of lines
- with open(filename) as f:
+ with open(histograms_path.GetInputFile(filename)) as f:
content = f.readlines()
# Parse out lines that are net errors.
@@ -43,12 +43,12 @@ def main():
sys.stderr.write(__doc__)
sys.exit(1)
- UpdateHistogramFromDict(
+ update_histogram_enum.UpdateHistogramFromDict(
'NetErrorCodes',
ReadNetErrorCodes(NET_ERROR_LIST_PATH, POSITIVE_ERROR_REGEX),
NET_ERROR_LIST_PATH)
- UpdateHistogramFromDict(
+ update_histogram_enum.UpdateHistogramFromDict(
'CombinedHttpResponseAndNetErrorCode',
ReadNetErrorCodes(NET_ERROR_LIST_PATH, NEGATIVE_ERROR_REGEX),
NET_ERROR_LIST_PATH)

Powered by Google App Engine
This is Rietveld 408576698