databaseconnection

This commit is contained in:
2024-11-20 15:46:01 +01:00
parent 0e8e03dc5d
commit 3d5035ffb3
8 changed files with 215 additions and 173 deletions

View File

@@ -6,6 +6,7 @@ from PySide6.QtCore import QObject, Slot
from .Vermasseln import Vermasseln
import shutil
from urllib.parse import urlparse
import os
class ConfigLoader(QObject):
__config = None
@@ -22,12 +23,13 @@ class ConfigLoader(QObject):
@Slot(str, str)
def importConfig(self, confile, password):
print(password)
confile = urlparse(confile)
print(confile.path)
#confile= confile.replace('file://','')
shutil.copyfile(confile.path, self.config_dir+ '/pyqcrm.toml')
confile = confile.path
if os.name == "nt":
confile = confile[1:]
shutil.copyfile(confile, self.config_dir+ '/pyqcrm.toml')
@Slot(dict)
def setConfig(self, app_config):
@@ -50,7 +52,7 @@ class ConfigLoader(QObject):
def getConfig(self):
print(self.__config['database'])
return self.__config
def createConfig(self):