Added configuration file handler and updated apps

This commit is contained in:
2021-11-18 07:23:23 -05:00
parent 19d85aebfe
commit 5d1e98eee6
3 changed files with 46 additions and 38 deletions

View File

@ -26,6 +26,8 @@ from MainWindow import Ui_MainWindow
import maidenhead as mh
from utils.configs import *
##############################################################################
# log
##############################################################################
@ -41,7 +43,6 @@ fix_mode = [
'0=None', '1=No', '2=2D', '3=3D'
];
config_file = "gps_tool.yaml"
gpsd_host="127.0.0.1"
gpsd_report = ()
@ -290,11 +291,10 @@ class QtGPSWindow(MainWindow):
self.log_enabled = 0
sys.exit(0)
if os.path.isfile(config_file):
with open(config_file) as f:
config = yaml.load(f, Loader=yaml.FullLoader)
if 'gpsd_host' in config:
gpsd_host = config['gpsd_host']
cfg = ConfigurationFile(__file__)
config = cfg.read_config()
if 'gpsd_host' in config:
gpsd_host = config['gpsd_host']
if __name__ == '__main__':
app = QApplication(sys.argv)