[python supervision] Fix paths (#2093). (#2236)

This commit is contained in:
Fabien-B
2018-03-12 11:24:30 +01:00
committed by Gautier Hattenberger
parent cf9401e5df
commit 3ee335965a
3 changed files with 4 additions and 4 deletions
-3
View File
@@ -1,3 +0,0 @@
#!/usr/bin/env /bin/sh
cd $PAPARAZZI_SRC/sw/supervision/python
./main.py
+1 -1
View File
@@ -13,7 +13,7 @@ let com =
if Array.length (Sys.argv) > 1 then begin if Array.length (Sys.argv) > 1 then begin
Printf.printf "%d\n" (Array.length (Sys.argv)); Printf.printf "%d\n" (Array.length (Sys.argv));
if Sys.argv.(1) = "-python" then if Sys.argv.(1) = "-python" then
dirname // "paparazzi-python.sh" dirname // "sw/supervision/python/main.py"
else else
dirname // "sw/supervision/paparazzicenter" dirname // "sw/supervision/paparazzicenter"
end end
+3
View File
@@ -37,6 +37,9 @@ import os
def main(): def main():
"""Main program : creates the main window and starts the main loop.""" """Main program : creates the main window and starts the main loop."""
# Set this file's location as working directory
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Set the environment variables (useful for some processes) : # Set the environment variables (useful for some processes) :
os.putenv(env.HOME_NAME, env.PAPARAZZI_HOME) os.putenv(env.HOME_NAME, env.PAPARAZZI_HOME)
os.putenv(env.SRC_NAME, env.PAPARAZZI_SRC) os.putenv(env.SRC_NAME, env.PAPARAZZI_SRC)