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

Unified Diff: tools/metrics/histograms/update_policies.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_policies.py
diff --git a/tools/metrics/histograms/update_policies.py b/tools/metrics/histograms/update_policies.py
index 79f524f690b97a526fb139a90d0fd5233679b797..346dcab18b55868cfc39ac1166328f51c8f3f505 100644
--- a/tools/metrics/histograms/update_policies.py
+++ b/tools/metrics/histograms/update_policies.py
@@ -16,15 +16,14 @@ from ast import literal_eval
from optparse import OptionParser
from xml.dom import minidom
-import print_style
-
-# Import the metrics/common module.
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
from diff_util import PromptUserToAcceptDiff
+import path_util
+
+import print_style
-HISTOGRAMS_PATH = 'histograms.xml'
-POLICY_TEMPLATES_PATH = (
- '../../../components/policy/resources/policy_templates.json')
+HISTOGRAMS_PATH = path_util.GetHistogramsFile()
+POLICY_TEMPLATES_PATH = 'components/policy/resources/policy_templates.json'
ENUM_NAME = 'EnterprisePolicies'
class UserError(Exception):
@@ -114,7 +113,7 @@ def main():
sys.stderr.write(__doc__)
sys.exit(1)
- with open(POLICY_TEMPLATES_PATH, 'rb') as f:
+ with open(path_util.GetInputFile(POLICY_TEMPLATES_PATH), 'rb') as f:
policy_templates = literal_eval(f.read())
with open(HISTOGRAMS_PATH, 'rb') as f:
histograms_doc = minidom.parse(f)
« no previous file with comments | « tools/metrics/histograms/update_net_error_codes.py ('k') | tools/metrics/histograms/update_use_counter_css.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698