From fc168f47ef272d3fd9212d43c62abce154a0bbcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 7 Feb 2018 14:50:29 +0100 Subject: [PATCH] Add support for tab switching on backend SourceCodeEventHandler --- src/event_handlers/source_code_event_handler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/event_handlers/source_code_event_handler.py b/src/event_handlers/source_code_event_handler.py index 0972079..17ca059 100644 --- a/src/event_handlers/source_code_event_handler.py +++ b/src/event_handlers/source_code_event_handler.py @@ -19,14 +19,14 @@ class FileManager: self.language = map_file_extension_to_language(self.filename) def select_file(self, filename): - if not self._filepath(filename) in self.files: + if not filename in self.files: raise EnvironmentError('No such file in workdir!') self.filename = filename self.language = map_file_extension_to_language(self.filename) @property def files(self): - return [file for file in glob(join(self._workdir, '**/*'), recursive=True) if isfile(file)] + return [basename(file) for file in glob(join(self._workdir, '**/*'), recursive=True) if isfile(file)] @property def file_contents(self): @@ -66,7 +66,8 @@ class SourceCodeEventHandler(EventHandlerBase, SupervisorMixin): data_json['data'] = { 'filename': self.filemanager.filename, 'content': self.filemanager.file_contents, - 'language': self.filemanager.language + 'language': self.filemanager.language, + 'files': self.filemanager.files } def write(self, data_json):