diff options
author | Clayton Smith <argilo@gmail.com> | 2021-10-23 22:39:31 -0400 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2021-10-25 13:55:03 -0700 |
commit | 921a433b3596ba23ac497af9b589a584ca2c32c7 (patch) | |
tree | 12df25e5e6021b756abc11286c6319ece2d3d0db /gr-utils/modtool/templates/gr-newmod/docs/doxygen/update_pydoc.py | |
parent | 39e88e44607fe750fc6cba456554213adf9b862a (diff) |
modtool: Clean up whitespace in templates
Signed-off-by: Clayton Smith <argilo@gmail.com>
Diffstat (limited to 'gr-utils/modtool/templates/gr-newmod/docs/doxygen/update_pydoc.py')
-rw-r--r-- | gr-utils/modtool/templates/gr-newmod/docs/doxygen/update_pydoc.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gr-utils/modtool/templates/gr-newmod/docs/doxygen/update_pydoc.py b/gr-utils/modtool/templates/gr-newmod/docs/doxygen/update_pydoc.py index ccf982ac9b..dd2fba79f2 100644 --- a/gr-utils/modtool/templates/gr-newmod/docs/doxygen/update_pydoc.py +++ b/gr-utils/modtool/templates/gr-newmod/docs/doxygen/update_pydoc.py @@ -264,7 +264,7 @@ def sub_docstring_in_pydoc_h(pydoc_files, docstrings_dict, output_dir, filter_st docstrings_dict = {k: v for k, v in docstrings_dict.items() if k.startswith(filter_str)} with open(os.path.join(output_dir,'docstring_status'),'w') as status_file: - + for pydoc_file in pydoc_files: if filter_str: filter_str2 = "::".join((filter_str,os.path.split(pydoc_file)[-1].split('_pydoc_template.h')[0])) @@ -275,16 +275,16 @@ def sub_docstring_in_pydoc_h(pydoc_files, docstrings_dict, output_dir, filter_st file_in = open(pydoc_file,'r').read() - for key, value in docstrings_dict2.items(): - file_in_tmp = file_in + for key, value in docstrings_dict2.items(): + file_in_tmp = file_in try: doc_key = key.split("::") # if 'gr' in doc_key: - # doc_key.remove('gr') + # doc_key.remove('gr') doc_key = '_'.join(doc_key) regexp = r'(__doc_{} =\sR\"doc\()[^)]*(\)doc\")'.format(doc_key) regexp = re.compile(regexp, re.MULTILINE) - + (file_in, nsubs) = regexp.subn(r'\1'+value+r'\2', file_in, count=1) if nsubs == 1: status_file.write("PASS: " + pydoc_file + "\n") @@ -311,7 +311,7 @@ def argParse(): """Parses commandline args.""" desc='Scrape the doxygen generated xml for docstrings to insert into python bindings' parser = ArgumentParser(description=desc) - + parser.add_argument("function", help="Operation to perform on docstrings", choices=["scrape","sub","copy"]) parser.add_argument("--xml_path") @@ -338,5 +338,3 @@ if __name__ == "__main__": elif args.function.lower() == 'copy': pydoc_files = glob.glob(os.path.join(args.bindings_dir,'*_pydoc_template.h')) copy_docstring_templates(pydoc_files, args.output_dir) - - |