| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 header_path, cpp_path = self.output_paths(interface_name) | 198 header_path, cpp_path = self.output_paths(interface_name) |
| 199 return ( | 199 return ( |
| 200 (header_path, header_text), | 200 (header_path, header_text), |
| 201 (cpp_path, cpp_text), | 201 (cpp_path, cpp_text), |
| 202 ) | 202 ) |
| 203 | 203 |
| 204 def generate_dictionary_code(self, definitions, dictionary_name, | 204 def generate_dictionary_code(self, definitions, dictionary_name, |
| 205 dictionary): | 205 dictionary): |
| 206 header_template = self.jinja_env.get_template('dictionary_v8.h') | 206 header_template = self.jinja_env.get_template('dictionary_v8.h') |
| 207 cpp_template = self.jinja_env.get_template('dictionary_v8.cpp') | 207 cpp_template = self.jinja_env.get_template('dictionary_v8.cpp') |
| 208 template_context = v8_dictionary.dictionary_context(dictionary) | 208 template_context = v8_dictionary.dictionary_context( |
| 209 dictionary, self.interfaces_info) |
| 209 interface_info = self.interfaces_info[dictionary_name] | 210 interface_info = self.interfaces_info[dictionary_name] |
| 210 include_paths = interface_info.get('dependencies_include_paths') | 211 include_paths = interface_info.get('dependencies_include_paths') |
| 211 # Add the include for interface itself | 212 # Add the include for interface itself |
| 212 template_context['header_includes'].add(interface_info['include_path']) | 213 template_context['header_includes'].add(interface_info['include_path']) |
| 213 header_text, cpp_text = render_template( | 214 header_text, cpp_text = render_template( |
| 214 include_paths, header_template, cpp_template, template_context) | 215 include_paths, header_template, cpp_template, template_context) |
| 215 header_path, cpp_path = self.output_paths(dictionary_name) | 216 header_path, cpp_path = self.output_paths(dictionary_name) |
| 216 return ( | 217 return ( |
| 217 (header_path, header_text), | 218 (header_path, header_text), |
| 218 (cpp_path, cpp_text), | 219 (cpp_path, cpp_text), |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 367 |
| 367 # Create a dummy file as output for the build system, | 368 # Create a dummy file as output for the build system, |
| 368 # since filenames of individual cache files are unpredictable and opaque | 369 # since filenames of individual cache files are unpredictable and opaque |
| 369 # (they are hashes of the template path, which varies based on environment) | 370 # (they are hashes of the template path, which varies based on environment) |
| 370 with open(dummy_filename, 'w') as dummy_file: | 371 with open(dummy_filename, 'w') as dummy_file: |
| 371 pass # |open| creates or touches the file | 372 pass # |open| creates or touches the file |
| 372 | 373 |
| 373 | 374 |
| 374 if __name__ == '__main__': | 375 if __name__ == '__main__': |
| 375 sys.exit(main(sys.argv)) | 376 sys.exit(main(sys.argv)) |
| OLD | NEW |