| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 sys | 6 import sys |
| 7 | 7 |
| 8 import json5_generator | 8 import json5_generator |
| 9 import template_expander | 9 import template_expander |
| 10 import make_style_builder | 10 import make_style_builder |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 api_methods=api_methods_for_class[classname], | 53 api_methods=api_methods_for_class[classname], |
| 54 )) | 54 )) |
| 55 | 55 |
| 56 @template_expander.use_jinja('CSSPropertyDescriptor.cpp.tmpl') | 56 @template_expander.use_jinja('CSSPropertyDescriptor.cpp.tmpl') |
| 57 def generate_property_descriptor_cpp(self): | 57 def generate_property_descriptor_cpp(self): |
| 58 return { | 58 return { |
| 59 'api_classes': self._api_classes, | 59 'api_classes': self._api_classes, |
| 60 'api_methods': self.json5_file.parameters['api_methods']['valid_valu
es'], | 60 'api_methods': self.json5_file.parameters['api_methods']['valid_valu
es'], |
| 61 } | 61 } |
| 62 | 62 |
| 63 # Provides a function object given the classname of the property. | 63 # This returned function generates a .h file for the specified property |
| 64 def generate_property_api_h_builder(self, api_classname, api_methods): | 64 def generate_property_api_h_builder(self, api_classname, api_methods): |
| 65 @template_expander.use_jinja('CSSPropertyAPIFiles.h.tmpl') | 65 @template_expander.use_jinja('CSSPropertyAPIFiles.h.tmpl') |
| 66 def generate_property_api_h(): | 66 def generate_property_api_h(): |
| 67 return { | 67 return { |
| 68 'api_classname': api_classname, | 68 'api_classname': api_classname, |
| 69 'api_methods': api_methods, | 69 'api_methods': api_methods, |
| 70 } | 70 } |
| 71 return generate_property_api_h | 71 return generate_property_api_h |
| 72 | 72 |
| 73 if __name__ == '__main__': | 73 if __name__ == '__main__': |
| 74 json5_generator.Maker(CSSPropertyAPIWriter).main() | 74 json5_generator.Maker(CSSPropertyAPIWriter).main() |
| OLD | NEW |