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

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

Issue 180743027: Re-land: Change actions.txt to actions.xml (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 9 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 | « tools/metrics/histograms/update_editor_commands.py ('k') | tools/metrics/histograms/update_policies.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/histograms/update_extension_functions.py
diff --git a/tools/metrics/histograms/update_extension_functions.py b/tools/metrics/histograms/update_extension_functions.py
index 3bc631550734389d3ef67ee8bd0d2b60b5afbef9..0783f32642f140467918c25420150b5354aa83bf 100644
--- a/tools/metrics/histograms/update_extension_functions.py
+++ b/tools/metrics/histograms/update_extension_functions.py
@@ -9,13 +9,16 @@ If the file was pretty-printed, the updated version is pretty-printed too.
"""
import logging
+import os
import re
import sys
from xml.dom import minidom
+import print_style
-from diffutil import PromptUserToAcceptDiff
-from pretty_print import PrettyPrintNode
+# Import the metrics/common module.
+sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
+from diff_util import PromptUserToAcceptDiff
HISTOGRAMS_PATH = 'histograms.xml'
ENUM_NAME = 'ExtensionFunctions'
@@ -136,7 +139,8 @@ def main():
UpdateHistogramDefinitions(histogram_values, histograms_doc)
Log('Writing out new histograms file.')
- new_xml = PrettyPrintNode(histograms_doc)
+ new_xml = print_style.GetPrintStyle().PrettyPrintNode(histograms_doc)
+
if PromptUserToAcceptDiff(xml, new_xml, 'Is the updated version acceptable?'):
with open(HISTOGRAMS_PATH, 'wb') as f:
f.write(new_xml)
« no previous file with comments | « tools/metrics/histograms/update_editor_commands.py ('k') | tools/metrics/histograms/update_policies.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698