Expose DirectoryMonitor instance from SourceCodeEventHandler

This commit is contained in:
Kristóf Tóth 2018-03-02 10:23:10 +01:00
parent e451de2179
commit 715e39af0d

View File

@ -53,8 +53,12 @@ class SourceCodeEventHandler(TriggerlessEventHandler):
'select': self.select
}
self.monitor = DirectoryMonitor(directory)
self.monitor.watch() # This runs on a separate thread
self._monitor = DirectoryMonitor(directory)
self._monitor.watch() # This runs on a separate thread
@property
def monitor(self):
return self._monitor
def read(self, data):
try: data['content'] = self.filemanager.file_contents