migrate from PyQt6 to PySide6, remove unneeded dependencies

This commit is contained in:
2025-06-17 16:21:56 +02:00
parent c3d9daa1b0
commit 7eb55c21d0
101 changed files with 898 additions and 464 deletions

View File

@@ -44,6 +44,19 @@ class AdminCommands:
hashed_password = self.hash_password("admin")
self.db.createUser("admin", salt + hashed_password, "admin", salt)
def create_user(self, username: str, password: str, role: str = "user"):
"""Create a new user in the database.
Args:
username (str): the username of the user to be created.
password (str): the password of the user to be created.
role (str, optional): the role of the user to be created. Defaults to "user".
"""
hashed_password, salt = self.create_password(password)
self.db.createUser(
user=username, password=salt + hashed_password, role=role, salt=salt
)
def hash_password(self, password: str) -> str:
"""Hash a password using SHA256.

View File

@@ -74,6 +74,7 @@ class Database:
os.makedirs(path)
if self.get_db_contents() == []:
log.critical("Database does not exist, creating tables")
log.critical(f"Path: {path}")
self.create_tables()
self.insertSubjects()

View File

@@ -1,4 +1,4 @@
from PyQt6.QtCore import QThread
from PySide6.QtCore import QThread
from src.utils.documentation import run_mkdocs

View File

@@ -1,5 +1,5 @@
from PyQt6.QtCore import QThread
from PyQt6.QtCore import pyqtSignal as Signal
from PySide6.QtCore import QThread
from PySide6.QtCore import Signal
from src.backend import Database
from src.logic.webrequest import BibTextTransformer, WebRequest

View File

@@ -1,8 +1,8 @@
import time
# from icecream import ic
from PyQt6.QtCore import QThread
from PyQt6.QtCore import pyqtSignal as Signal
from PySide6.QtCore import QThread
from PySide6.QtCore import Signal as Signal
from src.backend import Database
import loguru

View File

@@ -1,8 +1,8 @@
import time
# from icecream import ic
from PyQt6.QtCore import QThread
from PyQt6.QtCore import pyqtSignal as Signal
from PySide6.QtCore import QThread
from PySide6.QtCore import Signal as Signal
from src.backend.database import Database
from src import LOG_DIR