diff options
Diffstat (limited to 'gr-utils/modtool/core/bind.py')
-rw-r--r-- | gr-utils/modtool/core/bind.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gr-utils/modtool/core/bind.py b/gr-utils/modtool/core/bind.py index 3a960f2eef..29998babc7 100644 --- a/gr-utils/modtool/core/bind.py +++ b/gr-utils/modtool/core/bind.py @@ -39,6 +39,7 @@ class ModToolGenBindings(ModTool): self.info['pattern'] = blockname self.info['addl_includes'] = kwargs['addl_includes'] self.info['define_symbols'] = kwargs['define_symbols'] + self.info['fix_hash'] = kwargs['fix_hash'] def validate(self): """ Validates the arguments """ @@ -67,9 +68,13 @@ class ModToolGenBindings(ModTool): blocknames_to_process = get_block_names(self.info['pattern'], self.info['modname']) else: raise ModToolException("No block name or regex was specified!") - bg = BindingGenerator(prefix=gr.prefix(), namespace=[ - 'gr', self.info['modname']], prefix_include_root=self.info['modname'], output_dir=os.path.join(self.dir, 'python'), - define_symbols=self.info['define_symbols'], addl_includes=self.info['addl_includes']) + files_to_process = [os.path.join(self.dir, self.info['includedir'], f'{blockname}.h') for blockname in blocknames_to_process] + bg = BindingGenerator(prefix=gr.prefix(), namespace=[ + 'gr', self.info['modname']], prefix_include_root=self.info['modname'], output_dir=os.path.join(self.dir, 'python'), + define_symbols=self.info['define_symbols'], addl_includes=self.info['addl_includes'], fix_hash=self.info['fix_hash']) for file_to_process in files_to_process: - bg.gen_file_binding(file_to_process) + if self.info['fix_hash']: + bg.fix_file_hash(file_to_process) + else: + bg.gen_file_binding(file_to_process) |