diff --git a/lib/tfw/components/ide_event_handler.py b/lib/tfw/components/ide_event_handler/ide_event_handler.py similarity index 98% rename from lib/tfw/components/ide_event_handler.py rename to lib/tfw/components/ide_event_handler/ide_event_handler.py index da32cda..19d8652 100644 --- a/lib/tfw/components/ide_event_handler.py +++ b/lib/tfw/components/ide_event_handler/ide_event_handler.py @@ -16,7 +16,7 @@ LOG = logging.getLogger(__name__) class FileManager: # pylint: disable=too-many-instance-attributes def __init__(self, working_directory, allowed_directories, selected_file=None, exclude=None): - self._exclude, self.exclude = None, exclude + self._exclude, self.exclude = [], exclude self._allowed_directories, self.allowed_directories = None, allowed_directories self._workdir, self.workdir = None, working_directory self._filename, self.filename = None, selected_file or self.files[0] @@ -91,7 +91,8 @@ class FileManager: # pylint: disable=too-many-instance-attributes def _is_blacklisted(self, file): return any( - fnmatchcase(file, blacklisted) + fnmatchcase(file, blacklisted) or + fnmatchcase(basename(file), blacklisted) for blacklisted in self.exclude )