summaryrefslogtreecommitdiff
path: root/gr-utils/bindtool/scripts/header_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/bindtool/scripts/header_utils.py')
-rw-r--r--gr-utils/bindtool/scripts/header_utils.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/gr-utils/bindtool/scripts/header_utils.py b/gr-utils/bindtool/scripts/header_utils.py
index 4071f6fa86..94b16ceb6b 100644
--- a/gr-utils/bindtool/scripts/header_utils.py
+++ b/gr-utils/bindtool/scripts/header_utils.py
@@ -7,7 +7,7 @@ import re
class PybindHeaderParser:
def __init__(self, pathname):
try:
- with open(pathname,'r') as f:
+ with open(pathname, 'r') as f:
self.file_txt = f.read()
except:
self.file_txt = ""
@@ -42,10 +42,10 @@ class PybindHeaderParser:
except:
return None
-
def get_header_file_hash(self):
try:
- m = re.search(r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)', self.file_txt)
+ m = re.search(
+ r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)', self.file_txt)
if (m):
return m.group(1)
else:
@@ -57,17 +57,19 @@ class PybindHeaderParser:
return f'{self.get_flag_automatic()};{self.get_flag_pygccxml()};{self.get_header_filename()};{self.get_header_file_hash()};'
-
def argParse():
"""Parses commandline args."""
- desc='Reads the parameters from the comment block in the pybind files'
+ desc = 'Reads the parameters from the comment block in the pybind files'
parser = ArgumentParser(description=desc)
-
- parser.add_argument("function", help="Operation to perform on comment block of pybind file", choices=["flag_auto","flag_pygccxml","header_filename","header_file_hash","all"])
- parser.add_argument("pathname", help="Pathname of pybind c++ file to read, e.g. blockname_python.cc")
+
+ parser.add_argument("function", help="Operation to perform on comment block of pybind file", choices=[
+ "flag_auto", "flag_pygccxml", "header_filename", "header_file_hash", "all"])
+ parser.add_argument(
+ "pathname", help="Pathname of pybind c++ file to read, e.g. blockname_python.cc")
return parser.parse_args()
+
if __name__ == "__main__":
# Parse command line options and set up doxyxml.
args = argParse()
@@ -81,6 +83,6 @@ if __name__ == "__main__":
elif args.function == "header_filename":
print(pbhp.get_header_filename())
elif args.function == "header_file_hash":
- print(pbhp.get_header_file_hash())
+ print(pbhp.get_header_file_hash())
elif args.function == "all":
- print(pbhp.get_flags()) \ No newline at end of file
+ print(pbhp.get_flags())