exclude pattern

This commit is contained in:
Frank DeMarco 2015-08-16 19:12:24 -04:00
parent 3a937ddc96
commit 55576d6073
1 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ from distutils.command.install import install
from pprint import pprint
from fileinput import FileInput
from re import sub, match
from fnmatch import fnmatch
from Configuration import *
@ -48,8 +49,9 @@ class Setup:
def remove_excluded(self, paths, root, exclude):
removal = []
for path in paths:
if normpath(join(root, path)) in exclude:
removal.append(path)
for pattern in exclude:
if fnmatch(normpath(join(root, path)), pattern):
removal.append(path)
for path in removal:
paths.remove(path)
return paths