From cd809d0a2faa8731f40adf08570f7caf6ca88b05 Mon Sep 17 00:00:00 2001 From: pawanw17 Date: Sun, 11 Feb 2024 00:01:15 +0530 Subject: [PATCH] Exercise template check before running --- manager/manager/manager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/manager/manager/manager.py b/manager/manager/manager.py index e71fca3..3a4ab54 100644 --- a/manager/manager/manager.py +++ b/manager/manager/manager.py @@ -190,10 +190,15 @@ def add_frequency_control(self, code): def on_run_application(self, event): application_configuration = event.kwargs.get('data', {}) - application_file = application_configuration['template'] + application_file_path = application_configuration['template'] exercise_id = application_configuration['exercise_id'] code = application_configuration['code'] - + + if "noetic" in str(self.ros_version): + application_file = application_file_path + '/ros1_noetic/exercise.py' + else: + application_file = application_file_path + '/ros2_humble/exercise.py' + errors = self.linter.evaluate_code(code, exercise_id) if errors == "": code = self.add_frequency_control(code)