minor and major reworks: rename swb to SRU, add a test for pdf parsing

major: rework mail to send mail as plaintext instead of html, preventing the bleed-in of html text
This commit is contained in:
2025-10-07 14:15:10 +02:00
parent 0df7fd9fe6
commit 06965db26a
25 changed files with 1174 additions and 303 deletions

View File

@@ -1,4 +1,5 @@
import sys
from typing import List
import loguru
from natsort import natsorted
@@ -6,8 +7,9 @@ from PySide6 import QtCore, QtGui, QtWidgets
from PySide6.QtCore import Signal
from src import LOG_DIR
from src.backend import Database, Semester
from src.logic import BookData, Prof, custom_sort, sort_semesters_list
from src.backend import Database
from src.logic import BookData, Prof, Semester, custom_sort, sort_semesters_list
from src.logic.dataclass import Apparat
from src.ui.dialogs import ApparatExtendDialog, Mail_Dialog, ReminderDialog
from src.ui.widgets import DataQtGraph, StatusWidget
from src.ui.widgets.signature_update import UpdaterThread
@@ -343,8 +345,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
apparats = natsorted(appnrs)
apparats = [str(apparat) for apparat in apparats]
self.box_appnrs.addItems(apparats)
persons = self.db.getProfs()
persons = sorted(persons, key=lambda x: x.lastname)
persons: List[Prof] = sorted(self.db.getProfs(), key=lambda x: x.lastname)
self.box_person.addItems(
[f"{person.lastname}, {person.firstname}" for person in persons]
)
@@ -398,7 +399,12 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
selected_apparat_rows = []
for i in range(self.tableWidget.rowCount()):
if self.tableWidget.cellWidget(i, 0).isChecked():
selected_apparats.append(self.tableWidget.item(i, 2).text())
selected_apparats.append(
Apparat(
appnr=self.tableWidget.item(i, 2).text(),
name=self.tableWidget.item(i, 1).text(),
)
)
selected_apparat_rows.append(i)
# delete all selected apparats
# # ##print(selected_apparats)