check only the basename of a file by default

This commit is contained in:
Doug Hellmann 2014-11-11 15:44:03 -05:00
parent e56b2fb739
commit a3bf1a758c
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import abc
import fnmatch
import os
class FileHandler(object):
@ -10,7 +11,8 @@ class FileHandler(object):
def supports_file(self, file_obj):
"""Does this plugin want to process the file?
"""
return any(fnmatch.fnmatch(file_obj.path, ip)
base_filename = os.path.basename(file_obj.path)
return any(fnmatch.fnmatch(base_filename, ip)
for ip in self.INTERESTING_PATTERNS)
@abc.abstractmethod