mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-23 05:31:56 +00:00
Implement DirManagingEH selectdir API
This commit is contained in:
parent
7b834f8f25
commit
222143665c
@ -75,9 +75,10 @@ class DirectoryMonitoringEventHandler(TriggerlessEventHandler):
|
||||
self._directory = directory
|
||||
self._monitor = None
|
||||
self.reload_monitor()
|
||||
self.commands = {'pause': self.pause,
|
||||
'resume': self.resume,
|
||||
'ignore': self.ignore}
|
||||
self.commands = {'pause': self.pause,
|
||||
'resume': self.resume,
|
||||
'ignore': self.ignore,
|
||||
'selectdir': self.selectdir}
|
||||
|
||||
@property
|
||||
def directory(self):
|
||||
@ -118,5 +119,13 @@ class DirectoryMonitoringEventHandler(TriggerlessEventHandler):
|
||||
self.monitor.ignore += data['ignore']
|
||||
return data
|
||||
|
||||
def selectdir(self, data):
|
||||
try:
|
||||
self.directory = data['directory']
|
||||
self.reload_monitor()
|
||||
return data
|
||||
except EnvironmentError:
|
||||
log.error('DirManagingEH failed to switch directory!')
|
||||
|
||||
def cleanup(self):
|
||||
self.monitor.stop()
|
||||
|
Loading…
Reference in New Issue
Block a user