git » pygen » commit 046cc52

Implement exclusion lists.

author Alberto Bertogli
2007-09-01 17:52:25 UTC
committer Alberto Bertogli
2007-09-01 17:52:25 UTC
parent c8ff3abfb1ddc3576e0ff7de803fbb494acfad91

Implement exclusion lists.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

pygen +10 -0

diff --git a/pygen b/pygen
index 8c33f66..1c90238 100644
--- a/pygen
+++ b/pygen
@@ -127,6 +127,10 @@ def autogen(src, dst):
 		for d in dirs:
 			fulld = path + '/' + d
 			diff = fulld[len(srcroot):]
+
+			if [ x for x in options.exclude if diff[1:].startswith(x)]:
+				continue
+
 			p = os.path.normpath(dst + '/' + diff)
 			if os.path.islink(fulld):
 				files.append(d)
@@ -139,6 +143,10 @@ def autogen(src, dst):
 		for f in files:
 			fullf = path + '/' + f
 			diff = fullf[len(srcroot):]
+
+			if [ x for x in options.exclude if diff[1:].startswith(x)]:
+				continue
+
 			if diff.endswith('.pgh'):
 				# header files are ignored
 				print 'ignored', diff
@@ -180,6 +188,8 @@ if __name__ == '__main__':
 	parser = OptionParser(usage)
 	parser.add_option("-I", "--include", action = "append", default = [],
 			help = "Include directory for .pgh files")
+	parser.add_option("-x", "--exclude", action = "append", default = [],
+			help = "Paths to exclude from the generation")
 	#parser.add_option("-v", "--verbose", action = "store_true",
 	#		help = "Show additional information")