17 from fnmatch
import fnmatch
33 return set(exclude_file.read().split())
38 self.
write_excludeswrite_excludes(set([e
for e
in excludes
if e != path]))
41 excludes = [self.
_normalize_normalize(e)
for e
in excludes]
43 for exclude
in excludes:
46 exclude_file.write(
"%s\n" % exclude)
56 if not os.path.exists(self.
_exclude_file_path_exclude_file_path)
and read_write.startswith(
'r'):
61 raise NameError(
'"%s" is a directory, not file' % self.
_exclude_file_path_exclude_file_path)
74 excludes = [self.
_normalize_normalize(e)
for e
in excludes]
77 return any(self.
_match_match(path, e)
for e
in excludes)
81 return fnmatch(path, e)
or path.startswith(e)
85 if not (path
or path.strip()):
87 path = os.path.normcase(os.path.normpath(path))
88 ext = os.path.splitext(path)[1]
89 if not ext
and not path.endswith((
'*',
'?',
']')):
91 if '*' in path
or '?' in path
or ']' in path:
def contains(self, path, excludes=None)
def remove_path(self, path)
def __init__(self, directory)
def get_excludes(self, separator='\n')
def write_excludes(self, excludes)
def _get_exclude_file(self, read_write)
def update_excludes(self, new_excludes)