summaryrefslogtreecommitdiff
path: root/gr-utils/modtool/core/bind.py
diff options
context:
space:
mode:
authormormj <34754695+mormj@users.noreply.github.com>2021-10-22 16:37:09 -0400
committerGitHub <noreply@github.com>2021-10-22 16:37:09 -0400
commitc4f99a8842490d37010ec20cddc63f7cfdc69b6c (patch)
tree053464d10995fdcf869803ca3dd9524a1fcc6946 /gr-utils/modtool/core/bind.py
parent375b9573c6185f2713a211a087dfbabedeb50c05 (diff)
modtool: ability to fix the hash using modtool
* modtool: bind --update-hash-only command Signed-off-by: Josh Morman <jmorman@gnuradio.org>
Diffstat (limited to 'gr-utils/modtool/core/bind.py')
-rw-r--r--gr-utils/modtool/core/bind.py13
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)