mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-27 17:06:31 +08:00
[python] settings: get PAPARAZZI_SRC
still needs to be cleaned up and converted to proper modules..
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user