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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 callback_function) | 349 callback_function) |
350 if not is_testing_target(path): | 350 if not is_testing_target(path): |
351 template_context['exported'] = self.info_provider.specifier_for_expo
rt | 351 template_context['exported'] = self.info_provider.specifier_for_expo
rt |
352 template_context['header_includes'].append( | 352 template_context['header_includes'].append( |
353 self.info_provider.include_path_for_export) | 353 self.info_provider.include_path_for_export) |
354 template_context['header_includes'] = normalize_and_sort_includes( | 354 template_context['header_includes'] = normalize_and_sort_includes( |
355 template_context['header_includes']) | 355 template_context['header_includes']) |
356 template_context['code_generator'] = MODULE_PYNAME | 356 template_context['code_generator'] = MODULE_PYNAME |
357 header_text = header_template.render(template_context) | 357 header_text = header_template.render(template_context) |
358 cpp_text = cpp_template.render(template_context) | 358 cpp_text = cpp_template.render(template_context) |
359 header_path = posixpath.join(self.output_dir, 'V8%s.h' % callback_functi
on.name) | 359 header_path = posixpath.join(self.output_dir, '%s.h' % callback_function
.name) |
360 cpp_path = posixpath.join(self.output_dir, 'V8%s.cpp' % callback_functio
n.name) | 360 cpp_path = posixpath.join(self.output_dir, '%s.cpp' % callback_function.
name) |
361 return ( | 361 return ( |
362 (header_path, header_text), | 362 (header_path, header_text), |
363 (cpp_path, cpp_text), | 363 (cpp_path, cpp_text), |
364 ) | 364 ) |
365 | 365 |
366 # pylint: disable=W0221 | 366 # pylint: disable=W0221 |
367 def generate_code(self): | 367 def generate_code(self): |
368 callback_functions = self.info_provider.callback_functions | 368 callback_functions = self.info_provider.callback_functions |
369 if not callback_functions: | 369 if not callback_functions: |
370 return () | 370 return () |
371 outputs = set() | 371 outputs = set() |
372 for callback_function_dict in callback_functions.itervalues(): | 372 for callback_function_dict in callback_functions.itervalues(): |
373 if callback_function_dict['component_dir'] != self.target_component: | 373 if callback_function_dict['component_dir'] != self.target_component: |
374 continue | 374 continue |
375 callback_function = callback_function_dict['callback_function'] | 375 callback_function = callback_function_dict['callback_function'] |
376 path = callback_function_dict['full_path'] | 376 path = callback_function_dict['full_path'] |
377 outputs.update(self.generate_code_internal(callback_function, path)) | 377 outputs.update(self.generate_code_internal(callback_function, path)) |
378 return outputs | 378 return outputs |
OLD | NEW |