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

Side by Side Diff: tools/metrics/histograms/print_style.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, 6 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Holds the constants for pretty printing histograms.xml.""" 5 """Holds the constants for pretty printing histograms.xml."""
6 6
7 import os 7 import os
8 import sys 8 import sys
9 9
10 # Import the metrics/common module for pretty print xml.
11 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common')) 10 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
12 import pretty_print_xml 11 import pretty_print_xml
13 12
14 # Desired order for tag attributes; attributes listed here will appear first, 13 # Desired order for tag attributes; attributes listed here will appear first,
15 # and in the same order as in these lists. 14 # and in the same order as in these lists.
16 # { tag_name: [attribute_name, ...] } 15 # { tag_name: [attribute_name, ...] }
17 ATTRIBUTE_ORDER = { 16 ATTRIBUTE_ORDER = {
18 'enum': ['name', 'type'], 17 'enum': ['name', 'type'],
19 'histogram': ['name', 'enum', 'units'], 18 'histogram': ['name', 'enum', 'units'],
20 'int': ['value', 'label'], 19 'int': ['value', 'label'],
(...skipping 30 matching lines...) Expand all
51 'owner', 50 'owner',
52 ] 51 ]
53 52
54 53
55 def GetPrintStyle(): 54 def GetPrintStyle():
56 """Returns an XmlStyle object for pretty printing histograms.""" 55 """Returns an XmlStyle object for pretty printing histograms."""
57 return pretty_print_xml.XmlStyle(ATTRIBUTE_ORDER, 56 return pretty_print_xml.XmlStyle(ATTRIBUTE_ORDER,
58 TAGS_THAT_HAVE_EXTRA_NEWLINE, 57 TAGS_THAT_HAVE_EXTRA_NEWLINE,
59 TAGS_THAT_DONT_INDENT, 58 TAGS_THAT_DONT_INDENT,
60 TAGS_THAT_ALLOW_SINGLE_LINE) 59 TAGS_THAT_ALLOW_SINGLE_LINE)
OLDNEW
« no previous file with comments | « tools/metrics/histograms/pretty_print.py ('k') | tools/metrics/histograms/update_bad_message_reasons.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698