| Index: tools/metrics/common/models.py
|
| diff --git a/tools/metrics/common/models.py b/tools/metrics/common/models.py
|
| index dfae14e263181046d09186e256c6a7577e3d9357..2e8d92ccc289ab5297e9c43c51557664b167c376 100644
|
| --- a/tools/metrics/common/models.py
|
| +++ b/tools/metrics/common/models.py
|
| @@ -82,11 +82,13 @@ class NodeType(object):
|
| def __init__(self, tag,
|
| indent=True,
|
| extra_newlines=None,
|
| - single_line=False):
|
| + single_line=False,
|
| + alphabetization=None):
|
| self.tag = tag
|
| self.indent = indent
|
| self.extra_newlines = extra_newlines
|
| self.single_line = single_line
|
| + self.alphabetization = alphabetization
|
|
|
| @abc.abstractmethod
|
| def Unmarshall(self, node):
|
| @@ -369,7 +371,8 @@ class DocumentType(object):
|
| if types[t].extra_newlines},
|
| tags_that_dont_indent=[t for t in types if not types[t].indent],
|
| tags_that_allow_single_line=[t for t in types if types[t].single_line],
|
| - tags_alphabetization_rules={})
|
| + tags_alphabetization_rules={t: types[t].alphabetization for t in types
|
| + if types[t].alphabetization})
|
|
|
| def _ToXML(self, obj):
|
| """Converts an object into an XML document.
|
| @@ -393,4 +396,4 @@ class DocumentType(object):
|
| Returns:
|
| A string containing pretty printed XML.
|
| """
|
| - return self.GetPrintStyle().PrettyPrintNode(self._ToXML(obj))
|
| + return self.GetPrintStyle().PrettyPrintXml(self._ToXML(obj))
|
|
|