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):