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

Unified Diff: tools/metrics/histograms/pretty_print.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
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | tools/metrics/histograms/print_style.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/histograms/pretty_print.py
diff --git a/tools/metrics/histograms/pretty_print.py b/tools/metrics/histograms/pretty_print.py
index 41cc2b6126cba9876d454dd66a56bbd0cbe107c8..42f4e6b4e48accb2a24323fb3c0631893c92a98c 100755
--- a/tools/metrics/histograms/pretty_print.py
+++ b/tools/metrics/histograms/pretty_print.py
@@ -20,16 +20,12 @@ import shutil
import sys
import xml.dom.minidom
-import print_style
-
-sys.path.insert(1, os.path.join(sys.path[0], '..', '..', 'python'))
-from google import path_utils
-
-# Import the metrics/common module.
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
import diff_util
import presubmit_util
+import print_style
+
# Tags whose children we want to alphabetize. The key is the parent tag name,
# and the value is a pair of the tag name of the children we want to sort,
# and a key function that maps each child node to the desired sort key.
@@ -73,7 +69,8 @@ def TransformByAlphabetizing(node):
directly.
"""
if node.nodeType != xml.dom.minidom.Node.ELEMENT_NODE:
- for c in node.childNodes: TransformByAlphabetizing(c)
+ for c in node.childNodes:
+ TransformByAlphabetizing(c)
return node
# Element node with a tag name that we alphabetize the children of?
@@ -114,7 +111,8 @@ def TransformByAlphabetizing(node):
return node
# Recursively handle other element nodes and other node types.
- for c in node.childNodes: TransformByAlphabetizing(c)
+ for c in node.childNodes:
+ TransformByAlphabetizing(c)
return node
@@ -131,6 +129,7 @@ def PrettyPrint(raw_xml):
tree = TransformByAlphabetizing(tree)
return print_style.GetPrintStyle().PrettyPrintNode(tree)
+
def main():
presubmit_util.DoPresubmitMain(sys.argv, 'histograms.xml',
'histograms.before.pretty-print.xml',
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | tools/metrics/histograms/print_style.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698