mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 16:01:32 +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._directory = directory
|
||||||
self._monitor = None
|
self._monitor = None
|
||||||
self.reload_monitor()
|
self.reload_monitor()
|
||||||
self.commands = {'pause': self.pause,
|
self.commands = {'pause': self.pause,
|
||||||
'resume': self.resume,
|
'resume': self.resume,
|
||||||
'ignore': self.ignore}
|
'ignore': self.ignore,
|
||||||
|
'selectdir': self.selectdir}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def directory(self):
|
def directory(self):
|
||||||
@ -118,5 +119,13 @@ class DirectoryMonitoringEventHandler(TriggerlessEventHandler):
|
|||||||
self.monitor.ignore += data['ignore']
|
self.monitor.ignore += data['ignore']
|
||||||
return data
|
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):
|
def cleanup(self):
|
||||||
self.monitor.stop()
|
self.monitor.stop()
|
||||||
|
Loading…
Reference in New Issue
Block a user