| Index: Source/bindings/scripts/idl_compiler.py
|
| diff --git a/Source/bindings/scripts/idl_compiler.py b/Source/bindings/scripts/idl_compiler.py
|
| index c74aae7a002777349c65c6c18c68f1ae8c266ba8..5ed382cb9648522cd5547b4e8ad278502540f684 100755
|
| --- a/Source/bindings/scripts/idl_compiler.py
|
| +++ b/Source/bindings/scripts/idl_compiler.py
|
| @@ -38,7 +38,7 @@ import os
|
| import cPickle as pickle
|
| import sys
|
|
|
| -from code_generator_v8 import CodeGeneratorV8
|
| +from code_generator_v8 import CodeGeneratorV8, MODE_BINDINGS, MODE_DICTIONARY_IMPL
|
| from idl_reader import IdlReader
|
| from utilities import write_file
|
|
|
| @@ -47,6 +47,8 @@ def parse_options():
|
| parser = OptionParser()
|
| parser.add_option('--cache-directory',
|
| help='cache directory, defaults to output directory')
|
| + parser.add_option('--generate-dictionary-impl',
|
| + action="store_true", default=False)
|
| parser.add_option('--output-directory')
|
| parser.add_option('--interfaces-info-file')
|
| parser.add_option('--write-file-only-if-changed', type='int')
|
| @@ -81,7 +83,8 @@ class IdlCompiler(object):
|
|
|
| def __init__(self, output_directory, cache_directory='',
|
| code_generator=None, interfaces_info=None,
|
| - interfaces_info_filename='', only_if_changed=False):
|
| + interfaces_info_filename='', only_if_changed=False,
|
| + generate_dictionary_impl=False):
|
| """
|
| Args:
|
| interfaces_info:
|
| @@ -92,6 +95,10 @@ class IdlCompiler(object):
|
| cache_directory = cache_directory or output_directory
|
| self.cache_directory = cache_directory
|
| self.code_generator = code_generator
|
| + if generate_dictionary_impl:
|
| + self.generating_mode = MODE_DICTIONARY_IMPL
|
| + else:
|
| + self.generating_mode = MODE_BINDINGS
|
| if interfaces_info_filename:
|
| with open(interfaces_info_filename) as interfaces_info_file:
|
| interfaces_info = pickle.load(interfaces_info_file)
|
| @@ -104,7 +111,7 @@ class IdlCompiler(object):
|
| interface_name = idl_filename_to_interface_name(idl_filename)
|
| definitions = self.reader.read_idl_definitions(idl_filename)
|
| output_code_list = self.code_generator.generate_code(
|
| - definitions, interface_name)
|
| + definitions, interface_name, mode=self.generating_mode)
|
| for output_path, output_code in output_code_list:
|
| write_file(output_code, output_path, self.only_if_changed)
|
|
|
| @@ -130,7 +137,8 @@ def main():
|
| options.output_directory,
|
| cache_directory=options.cache_directory,
|
| interfaces_info_filename=options.interfaces_info_file,
|
| - only_if_changed=options.write_file_only_if_changed)
|
| + only_if_changed=options.write_file_only_if_changed,
|
| + generate_dictionary_impl=options.generate_dictionary_impl)
|
| idl_compiler.compile_file(idl_filename)
|
|
|
|
|
|
|