From a40e657922b0eb5b2956ac722f26fdc6505a5fbaa20acd23dc9679e2a9a3c6dc Mon Sep 17 00:00:00 2001 From: Daniel Stoppek Date: Thu, 14 Nov 2024 09:29:16 +0100 Subject: [PATCH] Change ConfigLoader.py tomllib > toml --- doc/database.txt | 2 ++ lib/ConfigLoader.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/database.txt b/doc/database.txt index 6cf9e1c..b4b5991 100644 --- a/doc/database.txt +++ b/doc/database.txt @@ -1,3 +1,5 @@ +host: bearybot.selfhost.co +port: 8080 user: pyqcrm pw: xOv1E55W@q0SE$&1Y6i#T0&kuQc^PX database: pyqcrm diff --git a/lib/ConfigLoader.py b/lib/ConfigLoader.py index 83867c7..b7548c6 100644 --- a/lib/ConfigLoader.py +++ b/lib/ConfigLoader.py @@ -1,5 +1,5 @@ # This Python file uses the following encoding: utf-8 -import tomllib +import toml from platformdirs import user_config_dir from pathlib import Path from PySide6.QtCore import QObject, Slot @@ -23,7 +23,7 @@ class ConfigLoader(QObject): def setConfig(self, app_config): try: with open (self.config_dir + '/pyqcrm.toml', 'w') as f: - config = Vermasseln().oscarVermasseln(tomllib.dumps(app_config)) + config = Vermasseln().oscarVermasseln(toml.dumps(app_config)) f.write(config) except FileNotFoundError: print("Konnte die Konfiguration nicht speichern.") @@ -33,7 +33,7 @@ class ConfigLoader(QObject): try: with open (self.config_dir + '/pyqcrm.toml', 'r') as f: config = f.read() - self.__config = tomllib.loads(Vermasseln().entschluesseln(config)) + self.__config = toml.loads(Vermasseln().entschluesseln(config)) except FileNotFoundError: print("Konnte die Konfiguration nicht laden.")