From 319a5cf97ccc00dd98a8fae440cd10aa49ce3101 Mon Sep 17 00:00:00 2001 From: Bruno da Silva de Oliveira Date: Sun, 30 Mar 2003 21:06:10 +0000 Subject: [PATCH] - Added the experimental command line option -R, which is a workaround a gccxml's preprocessor bug [SVN r18138] --- pyste/src/pyste.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pyste/src/pyste.py b/pyste/src/pyste.py index 33f014ae..a25a3a18 100644 --- a/pyste/src/pyste.py +++ b/pyste/src/pyste.py @@ -29,6 +29,17 @@ import time __VERSION__ = '0.6.4' +def RecursiveIncludes(include): + 'Return a list containg the include dir and all its subdirectories' + dirs = [include] + def visit(arg, dir, names): + # ignore CVS dirs + if os.path.split(dir)[1] != 'CVS': + dirs.append(dir) + os.path.walk(include, visit, None) + return dirs + + def GetDefaultIncludes(): if 'INCLUDE' in os.environ: include = os.environ['INCLUDE'] @@ -46,7 +57,7 @@ def ParseArguments(): try: options, files = getopt.getopt( sys.argv[1:], - 'I:D:vh', + 'R:I:D:vh', ['module=', 'out=', 'no-using', 'pyste-ns=', 'debug', 'version', 'help']) except getopt.GetoptError, e: print @@ -61,6 +72,8 @@ def ParseArguments(): includes.append(value) elif opt == '-D': defines.append(value) + elif opt == '-R': + includes.extend(RecursiveIncludes(value)) elif opt == '--module': module = value elif opt == '--out':