[python] settings: get PAPARAZZI_SRC

still needs to be cleaned up and converted to proper modules..
This commit is contained in:
Felix Ruess
2015-02-18 13:12:47 +01:00
parent 6706fac752
commit c24177f8ae
4 changed files with 14 additions and 4 deletions
@@ -7,7 +7,9 @@ import settingsframe
import getopt
import sys
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python")
PPRZ_SRC = os.getenv("PAPARAZZI_SRC", os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../../../..')))
sys.path.append(PPRZ_SRC + "/sw/lib/python")
import settings_xml_parse
def Usage(scmd):
@@ -6,7 +6,9 @@ import wx
import sys
import os
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python")
PPRZ_SRC = os.getenv("PAPARAZZI_SRC", os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../../../..')))
sys.path.append(PPRZ_SRC + "/sw/lib/python")
from settings_tool import IvySettingsInterface
+3 -1
View File
@@ -7,7 +7,9 @@ import os
import logging
import sys
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python")
PPRZ_SRC = os.getenv("PAPARAZZI_SRC", os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../../..')))
sys.path.append(PPRZ_SRC + "/sw/lib/python")
from settings_xml_parse import PaparazziACSettings
_SHOW_IVY_MSGS_ = False
+5 -1
View File
@@ -6,6 +6,10 @@ import os
import sys
from lxml import etree
# if PAPARAZZI_HOME not set, then assume the tree containing this
# file is a reasonable substitute
PPRZ_HOME = os.getenv("PAPARAZZI_HOME", os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../../..')))
# Class for all settings
class PaparazziACSettings:
"Paparazzi Settings Class"
@@ -18,7 +22,7 @@ class PaparazziACSettings:
def __init__(self, ac_id):
self.ac_id = ac_id
paparazzi_home = os.getenv("PAPARAZZI_HOME")
paparazzi_home = PPRZ_HOME
paparazzi_conf = os.path.join(paparazzi_home, 'conf')
conf_xml_path = os.path.join(paparazzi_conf, 'conf.xml')
conf_tree = etree.parse(conf_xml_path)