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', |