Refactor UI and remove unused tests

- Deleted the generated UI file `untitled_ui.py` as it is no longer needed.
- Updated `search_statistic_page.ui` to enhance table properties, including grid style and sort indicators.
- Modified `search_statistic_page_ui.py` to reflect changes in the UI file and improve table header settings.
- Improved cleanup logic in `richtext.py` to ensure files are only deleted if they exist.
- Adjusted spacing in document generation for better formatting.
- Removed obsolete test files: `database_test.py`, `many_webrequest_test.py`, `test_database.py`, and `webrequest_test.py` to clean up the test suite.
This commit is contained in:
2025-05-12 15:26:58 +02:00
parent d71de1bd1a
commit 8f90247e98
30 changed files with 79 additions and 2672 deletions

View File

@@ -167,8 +167,7 @@ li.unchecked::marker { content: "\2610"; }
li.checked::marker { content: "\2612"; }
</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:700; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">SELECT</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> semesterapparat.name,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> prof.lname</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> prof.lname || ' (' || semesterapparat.name || ')' AS formatted_result</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">from</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> semesterapparat</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> INNER JOIN prof ON semesterapparat.prof_id = prof.id</p>

View File

@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\documentprint.ui'
#
# Created by: PyQt6 UI code generator 6.8.0
# Created by: PyQt6 UI code generator 6.9.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
@@ -128,8 +128,7 @@ class Ui_Dialog(object):
"li.checked::marker { content: \"\\2612\"; }\n"
"</style></head><body style=\" font-family:\'Segoe UI\'; font-size:9pt; font-weight:700; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">SELECT</p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> semesterapparat.name,</p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> prof.lname</p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> prof.lname || \' (\' || semesterapparat.name || \')\' AS formatted_result</p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">from</p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> semesterapparat</p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> INNER JOIN prof ON semesterapparat.prof_id = prof.id</p>\n"

View File

@@ -54,7 +54,7 @@ class DocumentPrintDialog(QtWidgets.QDialog, Ui_Dialog):
self.tableWidget.setRowCount(0)
return
for row in data:
apparats.append(f"{row[1]} ({row[0]})")
apparats.append(f"{row[0]}")
self.tableWidget.setHorizontalHeaderLabels(["", "Semesterapparat"])
self.tableWidget.setColumnWidth(0, 50)
@@ -103,6 +103,7 @@ class DocumentPrintDialog(QtWidgets.QDialog, Ui_Dialog):
if item is not None:
checked_items.append(item.text())
document = SemapSchilder(checked_items)
document.send
def on_pushButton_clicked(self):
apparats: list[tuple[int, str]] = []
@@ -112,7 +113,7 @@ class DocumentPrintDialog(QtWidgets.QDialog, Ui_Dialog):
prof = self.db.getProfById(app[2])
data = (app[4], f"{prof.lastname} ({app[1]})")
apparats.append(data)
semapDocument = SemesterDocument(
SemesterDocument(
semester=self.semester.value,
filename="Semesterapparat",
full=True,
@@ -136,12 +137,12 @@ class DocumentPrintDialog(QtWidgets.QDialog, Ui_Dialog):
def get_valid_apparats_for_signs(self):
this_sem = self.db.query_db(
query="SELECT prof.lname, semesterapparat.name from semesterapparat INNER JOIN prof ON semesterapparat.prof_id = prof.id WHERE (erstellsemester = ? OR erstellsemester = ?) AND semesterapparat.deletion_status=0",
query="SELECT prof.lname || ' (' || semesterapparat.name || ')' AS formatted_result from semesterapparat INNER JOIN prof ON semesterapparat.prof_id = prof.id WHERE (erstellsemester = ? OR erstellsemester = ?) AND semesterapparat.deletion_status=0",
args=(str(self.semester.value), str(self.semester.previous)),
)
apparats: list[str] = []
for row in this_sem:
apparats.append(f"{row[0]} ({row[1]})")
apparats.append(f"{row[0]}")
return apparats