Change config file name
This commit is contained in:
@ -19,6 +19,8 @@ from PySide2.QtCore import QObject, Slot, Signal, QThread, QDir
|
||||
|
||||
from MainWindow import Ui_MainWindow
|
||||
|
||||
config_file = "vcones.yaml"
|
||||
|
||||
##############################################################################
|
||||
# audio stuff
|
||||
##############################################################################
|
||||
@ -218,6 +220,7 @@ class ConesWindow(MainWindow):
|
||||
self.openFiles.clicked.connect(self.read_dialog)
|
||||
self.exitButton.clicked.connect(self.exit_button)
|
||||
self.testSound.clicked.connect(self.test_sound)
|
||||
self.saveConfig.clicked.connect(self.save_config)
|
||||
|
||||
self.resetList1.clicked.connect(self.reset_list1)
|
||||
self.addPoint1.clicked.connect(self.add_point1)
|
||||
@ -522,7 +525,7 @@ class ConesWindow(MainWindow):
|
||||
self.save_list(5)
|
||||
|
||||
def save_config(self):
|
||||
with open('config.yaml', 'w') as f:
|
||||
with open(config_file, 'w') as f:
|
||||
config = {}
|
||||
if gpsd_host != "localhost":
|
||||
config['gpsd_host'] = gpsd_host
|
||||
@ -557,8 +560,8 @@ if __name__ == '__main__':
|
||||
window.show()
|
||||
|
||||
config = []
|
||||
if path.isfile('config.yaml'):
|
||||
with open('config.yaml') as f:
|
||||
if 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']
|
||||
|
||||
Reference in New Issue
Block a user