fix HostRSync filter matching (broken by the flake8 fixes)

This commit is contained in:
Ronny Pfannschmidt
2015-09-01 22:50:47 +02:00
parent b14e9a48e2
commit 24aeaad857

View File

@@ -154,13 +154,13 @@ class HostRSync(execnet.RSync):
ignores = kwargs.pop('ignores', None) or [] ignores = kwargs.pop('ignores', None) or []
for x in ignores: for x in ignores:
x = getattr(x, 'strpath', x) x = getattr(x, 'strpath', x)
self.ignores.append(re.compile(fnmatch.translate(x))) self._ignores.append(re.compile(fnmatch.translate(x)))
super(HostRSync, self).__init__(sourcedir=sourcedir, **kwargs) super(HostRSync, self).__init__(sourcedir=sourcedir, **kwargs)
def filter(self, path): def filter(self, path):
path = py.path.local(path) path = py.path.local(path)
for check in self._ignores: for cre in self._ignores:
if check(path.basename) or check(path.strpath): if cre.match(path.basename) or cre.match(path.strpath):
return False return False
else: else:
return True return True