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

Side by Side Diff: trunk/src/tools/metrics/histograms/print_style.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 """Holds the constants for pretty printing histograms.xml."""
6
7 import os
8 import sys
9
10 # Import the metrics/common module for pretty print xml.
11 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
12 import pretty_print_xml
13
14 # Desired order for tag attributes; attributes listed here will appear first,
15 # and in the same order as in these lists.
16 # { tag_name: [attribute_name, ...] }
17 ATTRIBUTE_ORDER = {
18 'enum': ['name', 'type'],
19 'histogram': ['name', 'enum', 'units'],
20 'int': ['value', 'label'],
21 'fieldtrial': ['name', 'separator', 'ordering'],
22 'group': ['name', 'label'],
23 'affected-histogram': ['name'],
24 'with-group': ['name'],
25 }
26
27 # Tag names for top-level nodes whose children we don't want to indent.
28 TAGS_THAT_DONT_INDENT = [
29 'histogram-configuration',
30 'histograms',
31 'fieldtrials',
32 'enums'
33 ]
34
35 # Extra vertical spacing rules for special tag names.
36 # {tag_name: (newlines_after_open, newlines_before_close, newlines_after_close)}
37 TAGS_THAT_HAVE_EXTRA_NEWLINE = {
38 'histogram-configuration': (2, 1, 1),
39 'histograms': (2, 1, 1),
40 'fieldtrials': (2, 1, 1),
41 'enums': (2, 1, 1),
42 'histogram': (1, 1, 1),
43 'enum': (1, 1, 1),
44 'fieldtrial': (1, 1, 1),
45 }
46
47 # Tags that we allow to be squished into a single line for brevity.
48 TAGS_THAT_ALLOW_SINGLE_LINE = [
49 'summary',
50 'int',
51 ]
52
53
OLDNEW
« no previous file with comments | « trunk/src/tools/metrics/histograms/pretty_print.py ('k') | trunk/src/tools/metrics/histograms/update_extension_functions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698