diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-11-01 15:07:32 -0400 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2019-11-05 21:08:27 +0000 |
commit | 464e5e0bfebc71c646e5c182535898cc7018236b (patch) | |
tree | db15d3d283afb96b9fa1b84928c2c434bb9bf775 /doxygen/filter_h.py | |
parent | ea1a65135e01311e31e94b8d0ed0721c9856775d (diff) |
docs: fix 'make doxygen' under python3
The 'make doxygen' component has this cool vpp specific customization called siphon.
This updates the siphon component so that 'make doxygen' works with python3.
Needed-By: https://gerrit.fd.io/r/23159
Type: docs
Change-Id: Ie29f1602bf3460b637058acbb0a2f19b128a8824
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'doxygen/filter_h.py')
-rwxr-xr-x | doxygen/filter_h.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/doxygen/filter_h.py b/doxygen/filter_h.py index 967388d5743..0891fa708e1 100755 --- a/doxygen/filter_h.py +++ b/doxygen/filter_h.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (c) 2016 Comcast Cable Communications Management, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +15,9 @@ # Filter for .c files to make various preprocessor tricks Doxygenish -import os, sys, re +import os +import re +import sys if len(sys.argv) < 2: sys.stderr.write("Usage: %s <filename>\n" % (sys.argv[0])) @@ -24,8 +26,9 @@ if len(sys.argv) < 2: replace_patterns = [ # Search for CLIB_PAD_FROM_TO(...); and replace with padding # #define CLIB_PAD_FROM_TO(from,to) u8 pad_##from[(to) - (from)] - ( re.compile("(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+),\s*(?P<to>[^)]+)[)]"), - r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]" ), + (re.compile(r"(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+)," + r"\s*(?P<to>[^)]+)[)]"), + r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]"), ] @@ -42,7 +45,7 @@ with open(filename) as fd: for line in fd: line_num += 1 - str = line[:-1] # filter \n + str = line[:-1] # filter \n # Look for search/replace patterns for p in replace_patterns: |