mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 16:01:32 +00:00
Expose DirManagingEH.directory as a property
This commit is contained in:
parent
aaaad9c459
commit
7b834f8f25
@ -1,5 +1,6 @@
|
|||||||
from watchdog.observers import Observer
|
from watchdog.observers import Observer
|
||||||
from watchdog.events import FileSystemEventHandler
|
from watchdog.events import FileSystemEventHandler
|
||||||
|
from os.path import exists, isdir
|
||||||
|
|
||||||
from tfw.networking.event_handlers.server_connector import ServerUplinkConnector
|
from tfw.networking.event_handlers.server_connector import ServerUplinkConnector
|
||||||
from tfw.components.decorators import RateLimiter
|
from tfw.components.decorators import RateLimiter
|
||||||
@ -78,6 +79,15 @@ class DirectoryMonitoringEventHandler(TriggerlessEventHandler):
|
|||||||
'resume': self.resume,
|
'resume': self.resume,
|
||||||
'ignore': self.ignore}
|
'ignore': self.ignore}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def directory(self):
|
||||||
|
return self._directory
|
||||||
|
|
||||||
|
@directory.setter
|
||||||
|
def directory(self, directory):
|
||||||
|
if not exists(directory) or not isdir(directory): raise EnvironmentError('No such directory!')
|
||||||
|
self._directory = directory
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def monitor(self):
|
def monitor(self):
|
||||||
return self._monitor
|
return self._monitor
|
||||||
|
Loading…
Reference in New Issue
Block a user