mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 15:41:32 +00:00
Implement DirManagingEH selectdir API
This commit is contained in:
parent
7b834f8f25
commit
222143665c
@ -77,7 +77,8 @@ class DirectoryMonitoringEventHandler(TriggerlessEventHandler):
|
||||
self.reload_monitor()
|
||||
self.commands = {'pause': self.pause,
|
||||
'resume': self.resume,
|
||||
'ignore': self.ignore}
|
||||
'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