X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=doxygen%2Ffilter_h.py;h=0891fa708e1cd5cb763c46c3c50ab1f2443efcfc;hb=16e4a4a0ae39ebc1ded1b6dba2799b176aee1828;hp=967388d57436ddf91824f2bb3f0fba1937b69438;hpb=16bcf7d8dcd411e6a6b8d217cce5e450f7357bb3;p=vpp.git 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 \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("(?PCLIB_PAD_FROM_TO)\s*[(](?P[^,]+),\s*(?P[^)]+)[)]"), - r"/** Padding. */ u8 pad_\g[(\g) - (\g)]" ), + (re.compile(r"(?PCLIB_PAD_FROM_TO)\s*[(](?P[^,]+)," + r"\s*(?P[^)]+)[)]"), + r"/** Padding. */ u8 pad_\g[(\g) - (\g)]"), ] @@ -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: