mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 16:41:32 +00:00
Remove unnecessary additional_dirs IdeEH.__init__ argument
This commit is contained in:
parent
edc46a8ae6
commit
92e9812776
@ -106,17 +106,13 @@ class IdeEventHandler(EventHandlerBase, MonitorManagerMixin):
|
|||||||
|
|
||||||
The API of each command is documented in their respective handler.
|
The API of each command is documented in their respective handler.
|
||||||
"""
|
"""
|
||||||
def __init__(self, key, directory, allowed_directories, selected_file=None, exclude=None,
|
def __init__(self, key, directory, allowed_directories, selected_file=None, exclude=None):
|
||||||
additional_watched_directories=None):
|
|
||||||
"""
|
"""
|
||||||
:param key: the key this instance should listen to
|
:param key: the key this instance should listen to
|
||||||
:param directory: working directory which the EventHandler should serve files from
|
:param directory: working directory which the EventHandler should serve files from
|
||||||
:param allowed_directories: list of directories that can be switched to using the selectdir command
|
:param allowed_directories: list of directories that can be switched to using the selectdir command
|
||||||
:param selected_file: file that is selected by default
|
:param selected_file: file that is selected by default
|
||||||
:param exclude: list of filenames that should not appear between files (for .o, .pyc, etc.)
|
:param exclude: list of filenames that should not appear between files (for .o, .pyc, etc.)
|
||||||
:param additional_watched_directories: refresh the selected file when files change in these directories
|
|
||||||
(the working directory is watched by default, this is useful for
|
|
||||||
symlinks and such)
|
|
||||||
"""
|
"""
|
||||||
super().__init__(key)
|
super().__init__(key)
|
||||||
try:
|
try:
|
||||||
@ -125,16 +121,19 @@ class IdeEventHandler(EventHandlerBase, MonitorManagerMixin):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
raise EnvironmentError(f'No file(s) in IdeEventHandler working_directory "{directory}"!')
|
raise EnvironmentError(f'No file(s) in IdeEventHandler working_directory "{directory}"!')
|
||||||
|
|
||||||
self.watched_directories = [self.filemanager.workdir]
|
MonitorManagerMixin.__init__(
|
||||||
if additional_watched_directories:
|
self,
|
||||||
self.watched_directories.extend(additional_watched_directories)
|
DirectoryMonitor,
|
||||||
MonitorManagerMixin.__init__(self, DirectoryMonitor, self.watched_directories)
|
self.filemanager.allowed_directories
|
||||||
|
)
|
||||||
|
|
||||||
self.commands = {'read': self.read,
|
self.commands = {
|
||||||
'write': self.write,
|
'read': self.read,
|
||||||
'select': self.select,
|
'write': self.write,
|
||||||
'selectdir': self.select_dir,
|
'select': self.select,
|
||||||
'exclude': self.exclude}
|
'selectdir': self.select_dir,
|
||||||
|
'exclude': self.exclude
|
||||||
|
}
|
||||||
|
|
||||||
def read(self, data):
|
def read(self, data):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user