mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-28 14:35:11 +00:00
Add method EventHandlerBase.cleanup()
This commit is contained in:
@ -58,7 +58,7 @@ class SourceCodeEventHandler(EventHandlerBase, SupervisorMixin):
|
||||
}
|
||||
|
||||
self.monitor = DirectoryMonitor(directory)
|
||||
self.monitor.watch() # This runs on a separate thread TODO: when to call stop()?
|
||||
self.monitor.watch() # This runs on a separate thread
|
||||
|
||||
def read(self, data):
|
||||
try: data['content'] = self.filemanager.file_contents
|
||||
@ -89,6 +89,9 @@ class SourceCodeEventHandler(EventHandlerBase, SupervisorMixin):
|
||||
self.attach_fileinfo(data)
|
||||
return data_json
|
||||
|
||||
def cleanup(self):
|
||||
self.monitor.stop()
|
||||
|
||||
|
||||
def map_file_extension_to_language(filename):
|
||||
language_map = {
|
||||
|
@ -23,6 +23,9 @@ class EventHandlerBase:
|
||||
def handle_reset(self, data_json):
|
||||
return None
|
||||
|
||||
def cleanup(self):
|
||||
pass
|
||||
|
||||
def message_other(self, anchor, data):
|
||||
message = {
|
||||
'anchor': anchor,
|
||||
|
Reference in New Issue
Block a user