| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 321 |
| 322 def output_paths(self, definition_name, interface_info): | 322 def output_paths(self, definition_name, interface_info): |
| 323 output_dir = posixpath.join(self.output_dir, | 323 output_dir = posixpath.join(self.output_dir, |
| 324 interface_info['relative_dir']) | 324 interface_info['relative_dir']) |
| 325 header_path = posixpath.join(output_dir, '%s.h' % definition_name) | 325 header_path = posixpath.join(output_dir, '%s.h' % definition_name) |
| 326 cpp_path = posixpath.join(output_dir, '%s.cpp' % definition_name) | 326 cpp_path = posixpath.join(output_dir, '%s.cpp' % definition_name) |
| 327 return header_path, cpp_path | 327 return header_path, cpp_path |
| 328 | 328 |
| 329 def generate_code_internal(self, definitions, definition_name): | 329 def generate_code_internal(self, definitions, definition_name): |
| 330 if not definition_name in definitions.dictionaries: | 330 if not definition_name in definitions.dictionaries: |
| 331 raise ValueError('%s is not an IDL dictionary') | 331 raise ValueError('%s is not an IDL dictionary' % definition_name) |
| 332 interfaces_info = self.info_provider.interfaces_info | 332 interfaces_info = self.info_provider.interfaces_info |
| 333 dictionary = definitions.dictionaries[definition_name] | 333 dictionary = definitions.dictionaries[definition_name] |
| 334 interface_info = interfaces_info[definition_name] | 334 interface_info = interfaces_info[definition_name] |
| 335 header_template = self.jinja_env.get_template('dictionary_impl.h') | 335 header_template = self.jinja_env.get_template('dictionary_impl.h') |
| 336 cpp_template = self.jinja_env.get_template('dictionary_impl.cpp') | 336 cpp_template = self.jinja_env.get_template('dictionary_impl.cpp') |
| 337 template_context = v8_dictionary.dictionary_impl_context( | 337 template_context = v8_dictionary.dictionary_impl_context( |
| 338 dictionary, interfaces_info) | 338 dictionary, interfaces_info) |
| 339 include_paths = interface_info.get('dependencies_include_paths') | 339 include_paths = interface_info.get('dependencies_include_paths') |
| 340 if not is_testing_target(interface_info.get('full_path')): | 340 if not is_testing_target(interface_info.get('full_path')): |
| 341 template_context['exported'] = self.info_provider.specifier_for_expo
rt | 341 template_context['exported'] = self.info_provider.specifier_for_expo
rt |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 479 |
| 480 # Create a dummy file as output for the build system, | 480 # Create a dummy file as output for the build system, |
| 481 # since filenames of individual cache files are unpredictable and opaque | 481 # since filenames of individual cache files are unpredictable and opaque |
| 482 # (they are hashes of the template path, which varies based on environment) | 482 # (they are hashes of the template path, which varies based on environment) |
| 483 with open(dummy_filename, 'w') as dummy_file: | 483 with open(dummy_filename, 'w') as dummy_file: |
| 484 pass # |open| creates or touches the file | 484 pass # |open| creates or touches the file |
| 485 | 485 |
| 486 | 486 |
| 487 if __name__ == '__main__': | 487 if __name__ == '__main__': |
| 488 sys.exit(main(sys.argv)) | 488 sys.exit(main(sys.argv)) |
| OLD | NEW |