From 39502cb75789ed8b1a2d4ce253b96d853bce8dfc Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Wed, 13 Sep 2023 00:57:29 +0530 Subject: [PATCH] Bugfix: config load --- setting.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setting.py b/setting.py index b68b42d..3728214 100644 --- a/setting.py +++ b/setting.py @@ -8,7 +8,6 @@ from PyQt6.QtWidgets import QWidget, QMainWindow, QFormLayout, QHBoxLayout, QPushButton, QLabel, QLineEdit, QTextEdit, QComboBox, QCheckBox, QStatusBar, QMessageBox, QFileDialog from PyQt6.QtGui import QIcon from PyQt6.QtCore import pyqtSignal -from copy import deepcopy import os, json from config import config, config_file @@ -33,8 +32,7 @@ class EditConfiguration(QMainWindow): def load(self): try: - self.file=self.config["filename"] - self.statusbar.showMessage(self.file) + self.statusbar.showMessage(config_file) self.input_directory.setText(self.config["data_directory"]) self.input_prescriber.setText(self.config["prescriber"]) self.input_newline.setChecked(bool(self.config["preset_newline"])) @@ -65,7 +63,8 @@ class EditConfiguration(QMainWindow): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.config=deepcopy(config) + with open(config_file) as f: + self.config=json.loads(f.read()) self.setWindowTitle("MedScript") self.setGeometry(200, 200, 300, 200) -- 2.39.2