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

Unified Diff: trunk/src/tools/metrics/histograms/update_policies.py

Issue 188793003: Revert 255357 "Change the user action file format from .txt to ...." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 | « trunk/src/tools/metrics/histograms/update_extension_functions.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/tools/metrics/histograms/update_policies.py
===================================================================
--- trunk/src/tools/metrics/histograms/update_policies.py (revision 255402)
+++ trunk/src/tools/metrics/histograms/update_policies.py (working copy)
@@ -8,7 +8,6 @@
If the file was pretty-printed, the updated version is pretty-printed too.
"""
-import os
import re
import sys
@@ -16,15 +15,12 @@
from optparse import OptionParser
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'
-POLICY_TEMPLATES_PATH = (
- '../../../components/policy/resources/policy_templates.json')
+POLICY_TEMPLATES_PATH =
+ '../../../components/policy/resources/policy_templates.json'
ENUM_NAME = 'EnterprisePolicies'
class UserError(Exception):
@@ -122,7 +118,8 @@
xml = f.read()
UpdateHistogramDefinitions(policy_templates, histograms_doc)
- new_xml = print_style.GetPrintStyle().PrettyPrintNode(histograms_doc)
+
+ new_xml = 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 | « trunk/src/tools/metrics/histograms/update_extension_functions.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698