File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
vue-frontend/src/components Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -157,13 +157,15 @@ export default {
157157 this .shell_socket .send (" cd /home/mirte/workdir\n " );
158158 this .shell_socket .send (" ps aux | grep 'python3 -i -c' | awk '{print $2}' | xargs kill -9\n " ); // TODO: this should be fixed in the backend
159159 this .shell_socket .send (" history -c\n " );
160- this .shell_socket .send (" python3 -i -c 'from mirte_robot import robot; mirte=robot.createRobot()'\n " );
160+ this .shell_socket .send (" python3 -i -c 'from mirte_robot import robot; import importlib.util; mirte=robot.createRobot()'\n " );
161161 }
162162 else if (this .$store .getters .getExecution == " initializing" && ev .data .slice (- 4 ) == " >>> " ){
163163 this .shell_socket .send (' def run():\n ' );
164164 this .shell_socket .send (' try:\n ' );
165165 this .shell_socket .send (' print("\\ 033[38;2;0;0;0m", end="")\n ' );
166- this .shell_socket .send (' exec(open("/home/mirte/workdir/mirte.py").read())\n ' );
166+ this .shell_socket .send (' spec = importlib.util.spec_from_file_location("mirte", "/home/mirte/workdir/mirte.py")\n ' );
167+ this .shell_socket .send (' mod = importlib.util.module_from_spec(spec)\n ' );
168+ this .shell_socket .send (' spec.loader.exec_module(mod)\n ' );
167169 this .shell_socket .send (' print("\\ 033[38;2;254;250;247m", end="")\n ' );
168170 this .shell_socket .send (' except:\n ' );
169171 this .shell_socket .send (' print("\\ r", end="")\n ' );
You can’t perform that action at this time.
0 commit comments