| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import logging | 6 import logging |
| 7 import os |
| 7 import sys | 8 import sys |
| 8 import os | |
| 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 models | 11 import models |
| 13 import presubmit_util | 12 import presubmit_util |
| 14 | 13 |
| 15 | 14 |
| 16 # Model definitions for rappor.xml content | 15 # Model definitions for rappor.xml content |
| 17 _SUMMARY_TYPE = models.TextNodeType('summary') | 16 _SUMMARY_TYPE = models.TextNodeType('summary') |
| 18 | 17 |
| 19 _PARAMETERS_TYPE = models.ObjectNodeType('parameters', | 18 _PARAMETERS_TYPE = models.ObjectNodeType('parameters', |
| 20 int_attributes=[ | 19 int_attributes=[ |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 return RAPPOR_XML_TYPE.PrettyPrint(comments, config) | 175 return RAPPOR_XML_TYPE.PrettyPrint(comments, config) |
| 177 | 176 |
| 178 | 177 |
| 179 def main(argv): | 178 def main(argv): |
| 180 presubmit_util.DoPresubmitMain(argv, 'rappor.xml', 'rappor.old.xml', | 179 presubmit_util.DoPresubmitMain(argv, 'rappor.xml', 'rappor.old.xml', |
| 181 'pretty_print.py', UpdateXML) | 180 'pretty_print.py', UpdateXML) |
| 182 | 181 |
| 183 | 182 |
| 184 if '__main__' == __name__: | 183 if '__main__' == __name__: |
| 185 sys.exit(main(sys.argv)) | 184 sys.exit(main(sys.argv)) |
| OLD | NEW |