diff options
Diffstat (limited to 'gr-utils/modtool/core/add.py')
-rw-r--r-- | gr-utils/modtool/core/add.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gr-utils/modtool/core/add.py b/gr-utils/modtool/core/add.py index 712d44de48..872d0a08a9 100644 --- a/gr-utils/modtool/core/add.py +++ b/gr-utils/modtool/core/add.py @@ -254,10 +254,18 @@ class ModToolAdd(ModTool): 'interpolator', 'general', 'hier', 'tagged_stream'): block_base = code_generator.GRTYPELIST[self.info['blocktype']] + import hashlib + header_file = self.info['blockname'] + '.h' + hasher = hashlib.md5() + with open(os.path.join(self.info['includedir'], header_file), 'rb') as file_in: + buf = file_in.read() + hasher.update(buf) + md5hash = hasher.hexdigest() + header_info = { "module_name": self.info['modname'], - "filename": self.info['blockname'] + '.h', - "md5hash": "0", + "filename": header_file, + "md5hash": md5hash, "namespace": { "name": "::".join(['gr', self.info['modname']]), "enums": [], |