mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-22 19:41:56 +00:00
Implement SourceCodeEventHandler blacklist manipulating API
This commit is contained in:
parent
aa54e40f14
commit
cc87540171
@ -77,7 +77,8 @@ class SourceCodeEventHandler(TriggerlessEventHandler):
|
||||
self.commands = {'read': self.read,
|
||||
'write': self.write,
|
||||
'select': self.select,
|
||||
'selectdir': self.select_dir}
|
||||
'selectdir': self.select_dir,
|
||||
'exclude': self.exclude}
|
||||
|
||||
self._monitor = None
|
||||
self.reload_monitor()
|
||||
@ -125,6 +126,11 @@ class SourceCodeEventHandler(TriggerlessEventHandler):
|
||||
log.error('Failed to select directory "{}"'.format(data['directory']))
|
||||
return data
|
||||
|
||||
def exclude(self, data):
|
||||
try: self.filemanager.exclude = list(data['exclude'])
|
||||
except TypeError: log.error('Exclude must be Iterable!')
|
||||
return data
|
||||
|
||||
def attach_fileinfo(self, data):
|
||||
data['filename'] = self.filemanager.filename
|
||||
data['files'] = self.filemanager.files
|
||||
|
Loading…
Reference in New Issue
Block a user