EXPERIMENTAL: switch from PyQt6 to PySide6

This commit is contained in:
WorldTeacher
2024-02-22 21:20:57 +01:00
parent 6d1119783f
commit d6a9868640
37 changed files with 326 additions and 226 deletions

View File

@@ -2,11 +2,11 @@
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml # To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1 version: 0.1
cli: cli:
version: 1.19.0 version: 1.20.0
plugins: plugins:
sources: sources:
- id: trunk - id: trunk
ref: v1.4.2 ref: v1.4.3
uri: https://github.com/trunk-io/plugins uri: https://github.com/trunk-io/plugins
runtimes: runtimes:
enabled: enabled:
@@ -29,10 +29,10 @@ lint:
- sql-formatter@15.2.0 - sql-formatter@15.2.0
- sqlfluff@2.3.5 - sqlfluff@2.3.5
- isort@5.13.2 - isort@5.13.2
- ruff@0.2.1 - ruff@0.2.2
- bandit@1.7.7 - bandit@1.7.7
- markdownlint@0.39.0 - markdownlint@0.39.0
- yamllint@1.34.0 - yamllint@1.35.1
- black@24.2.0 - black@24.2.0
actions: actions:
disabled: disabled:

View File

@@ -1,18 +1,20 @@
import sqlite3
import threading import threading
import time import time
from PyQt6.QtCore import QThread, pyqtSignal from icecream import ic
from PySide6.QtCore import QThread, Signal
from src.backend.database import Database from src.backend.database import Database
from src.logic.log import MyLogger from src.logic.log import MyLogger
from src.transformers import RDS_AVAIL_DATA
from src.logic.webrequest import BibTextTransformer, WebRequest from src.logic.webrequest import BibTextTransformer, WebRequest
import sqlite3 from src.transformers import RDS_AVAIL_DATA
from icecream import ic
class BookGrabber(QThread): class BookGrabber(QThread):
updateSignal = pyqtSignal(int, int) updateSignal = Signal(int, int)
done = pyqtSignal() done = Signal()
def __init__(self, app_id, prof_id, mode, data, parent=None): def __init__(self, app_id, prof_id, mode, data, parent=None):
super(BookGrabber, self).__init__(parent=None) super(BookGrabber, self).__init__(parent=None)
self.is_Running = True self.is_Running = True
@@ -27,8 +29,6 @@ class BookGrabber(QThread):
ic(self.state) ic(self.state)
time.sleep(2) time.sleep(2)
# def resetValues(self): # def resetValues(self):
# self.app_id = None # self.app_id = None
# self.prof_id = None # self.prof_id = None
@@ -94,13 +94,15 @@ class BookGrabber(QThread):
self.stop() self.stop()
if not self.is_Running: if not self.is_Running:
break break
def stop(self): def stop(self):
self.is_Running = False self.is_Running = False
class AvailChecker(QThread): class AvailChecker(QThread):
updateSignal = pyqtSignal(str, int) updateSignal = Signal(str, int)
updateProgress = pyqtSignal(int,int) updateProgress = Signal(int, int)
def __init__( def __init__(
self, links: list = None, appnumber: int = None, parent=None, books=list[dict] self, links: list = None, appnumber: int = None, parent=None, books=list[dict]
): ):
@@ -119,8 +121,11 @@ class AvailChecker(QThread):
self.links = links self.links = links
self.appnumber = appnumber self.appnumber = appnumber
self.books = books self.books = books
self.logger.log_info(f"Started worker with appnumber: {self.appnumber} and links: {self.links} and {len(self.books)} books...") self.logger.log_info(
f"Started worker with appnumber: {self.appnumber} and links: {self.links} and {len(self.books)} books..."
)
time.sleep(2) time.sleep(2)
def run(self): def run(self):
self.db = Database() self.db = Database()
state = 0 state = 0
@@ -144,12 +149,7 @@ class AvailChecker(QThread):
book_id = book["id"] book_id = book["id"]
break break
self.logger.log_info(f"State of {link}: " + str(state)) self.logger.log_info(f"State of {link}: " + str(state))
print( print("Updating availability of " + str(book_id) + " to " + str(state))
"Updating availability of "
+ str(book_id)
+ " to "
+ str(state)
)
self.db.setAvailability(book_id, state) self.db.setAvailability(book_id, state)
count += 1 count += 1
self.updateProgress.emit(count, len(self.links)) self.updateProgress.emit(count, len(self.links))
@@ -162,10 +162,10 @@ class AvailChecker(QThread):
class AutoAdder(QThread): class AutoAdder(QThread):
updateSignal = pyqtSignal(int) updateSignal = Signal(int)
setTextSignal = pyqtSignal(int) setTextSignal = Signal(int)
progress = pyqtSignal(int) progress = Signal(int)
def __init__(self, data=None, app_id=None, prof_id=None, parent=None): def __init__(self, data=None, app_id=None, prof_id=None, parent=None):
super().__init__(parent) super().__init__(parent)
@@ -206,10 +206,13 @@ class AutoAdder(QThread):
# teminate thread # teminate thread
self.finished.emit() self.finished.emit()
class BackgroundChecker(QThread): class BackgroundChecker(QThread):
"""Check all apparats for available Books""" """Check all apparats for available Books"""
pass pass
class MockAvailCheck: class MockAvailCheck:
def __init__( def __init__(
@@ -264,6 +267,5 @@ class MockAvailCheck:
count += 1 count += 1
return result return result
self.logger.log_info("Worker thread finished") self.logger.log_info("Worker thread finished")
# teminate thread # teminate thread

View File

@@ -6,19 +6,30 @@ import os
import sys import sys
import tempfile import tempfile
import time import time
from pathlib import Path
import webbrowser import webbrowser
from pathlib import Path
from icecream import ic
from natsort import natsorted from natsort import natsorted
from omegaconf import OmegaConf from omegaconf import OmegaConf
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6.QtCore import QDate, QThread, pyqtSignal from PySide6.QtCore import QDate, QThread, Signal
from PyQt6.QtGui import QColor, QRegularExpressionValidator from PySide6.QtGui import QColor, QRegularExpressionValidator
from src.logic import c_sort
# from src.logic.webrequest import BibTextTransformer, WebRequest
# from src.utils import documentationview
from src.backend.admin_console import AdminCommands
from src.backend.create_file import recreateFile
from src.backend.database import Database from src.backend.database import Database
from src.backend.delete_temp_contents import delete_temp_contents
from src.backend.semester import generateSemesterByDate
from src.logic import c_sort
from src.logic.constants import APP_NRS, PROF_TITLES from src.logic.constants import APP_NRS, PROF_TITLES
from src.logic.csvparser import csv_to_list
from src.logic.dataclass import ApparatData, BookData, MailData, Subjects from src.logic.dataclass import ApparatData, BookData, MailData, Subjects
from src.logic.log import MyLogger from src.logic.log import MyLogger
from src.logic.threads import BookGrabber,AvailChecker from src.logic.threads import AvailChecker, BookGrabber
from src.logic.wordparser import word_docx_to_csv
from src.ui import ( from src.ui import (
App_Ext_Dialog, App_Ext_Dialog,
FilePicker, FilePicker,
@@ -34,15 +45,7 @@ from src.ui import (
reminder_ui, reminder_ui,
settings_ui, settings_ui,
) )
# from src.logic.webrequest import BibTextTransformer, WebRequest
from src.utils import documentationview
from src.backend.admin_console import AdminCommands
from src.backend.semester import generateSemesterByDate
from src.backend.create_file import recreateFile
from src.backend.delete_temp_contents import delete_temp_contents
from src.logic.csvparser import csv_to_list
from src.logic.wordparser import word_docx_to_csv
from icecream import ic
config = OmegaConf.load("config.yaml") config = OmegaConf.load("config.yaml")
@@ -70,6 +73,7 @@ class Medien(medienadder_ui):
# self.btn_save_path_select.clicked.connect(self.select_save_path) # self.btn_save_path_select.clicked.connect(self.select_save_path)
# # self.setWindowIcon(QtGui.QIcon("ui\icon.png")) # # self.setWindowIcon(QtGui.QIcon("ui\icon.png"))
# def select_save_path(self) -> None: # def select_save_path(self) -> None:
# # open a dialog to select a save path # # open a dialog to select a save path
# dialog = QtWidgets.QFileDialog() # dialog = QtWidgets.QFileDialog()
@@ -84,6 +88,7 @@ class MyComboBox(QtWidgets.QComboBox):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(parent) super().__init__(parent)
valid_input = (0, 0, 0, 0, 0, 0) valid_input = (0, 0, 0, 0, 0, 0)
@@ -291,7 +296,9 @@ class Ui(Ui_Semesterapparat):
self.select_action_box.setCurrentText("") self.select_action_box.setCurrentText("")
self.hide_all() self.hide_all()
self.select_action_box.currentTextChanged.connect(self.admin_action_changed) self.select_action_box.currentTextChanged.connect(self.admin_action_changed)
self.edit_faculty_member_select_member.currentTextChanged.connect(self.edit_faculty_member_set_data) self.edit_faculty_member_select_member.currentTextChanged.connect(
self.edit_faculty_member_set_data
)
self.book_search.clicked.connect(self.search_book) self.book_search.clicked.connect(self.search_book)
# enable click functionality for the combobox to allow selection of roles # enable click functionality for the combobox to allow selection of roles
@@ -301,6 +308,7 @@ class Ui(Ui_Semesterapparat):
self.pushButton.clicked.connect(self.delete_user) self.pushButton.clicked.connect(self.delete_user)
self.update_user.clicked.connect(self.update_user_data) self.update_user.clicked.connect(self.update_user_data)
self.update_faculty_member.clicked.connect(self.edit_faculty_member_action) self.update_faculty_member.clicked.connect(self.edit_faculty_member_action)
def populate_appfach_dropdown(self): def populate_appfach_dropdown(self):
self.app_fach.clear() self.app_fach.clear()
self.app_fach.addItem("") self.app_fach.addItem("")
@@ -308,8 +316,10 @@ class Ui(Ui_Semesterapparat):
self.app_fach.addItems([subject[1] for subject in self.db.getSubjects()]) self.app_fach.addItems([subject[1] for subject in self.db.getSubjects()])
def open_documentation(self): def open_documentation(self):
documentation = documentationview.DocumentationViewer() # open the documentation in the default browser
documentation.show() webbrowser.open("file:///" + os.path.abspath("docs/index.html"))
# documentation = documentationview.DocumentationViewer()
# documentation.show()
def tabW1_changed(self): def tabW1_changed(self):
if self.tabWidget.currentIndex() == 1: if self.tabWidget.currentIndex() == 1:
@@ -323,7 +333,7 @@ class Ui(Ui_Semesterapparat):
title = self.search_by_title.text() title = self.search_by_title.text()
params = { params = {
"signature": signature if signature != "" else None, "signature": signature if signature != "" else None,
"title": title if title != "" else None "title": title if title != "" else None,
} }
params = {key: value for key, value in params.items() if value is not None} params = {key: value for key, value in params.items() if value is not None}
ic(params) ic(params)
@@ -333,10 +343,18 @@ class Ui(Ui_Semesterapparat):
for book in retdata: for book in retdata:
self.book_search_result.insertRow(0) self.book_search_result.insertRow(0)
self.book_search_result.setItem(0,0,QtWidgets.QTableWidgetItem(book[0].title)) self.book_search_result.setItem(
self.book_search_result.setItem(0,1,QtWidgets.QTableWidgetItem(book[0].signature)) 0, 0, QtWidgets.QTableWidgetItem(book[0].title)
)
self.book_search_result.setItem(
0, 1, QtWidgets.QTableWidgetItem(book[0].signature)
)
print(book[1]) print(book[1])
self.book_search_result.setItem(0,2,QtWidgets.QTableWidgetItem(self.db.getApparatName(book[1],book[2]))) self.book_search_result.setItem(
0,
2,
QtWidgets.QTableWidgetItem(self.db.getApparatName(book[1], book[2])),
)
def edit_faculty_member_set_data(self): def edit_faculty_member_set_data(self):
# get the selected member # get the selected member
@@ -356,7 +374,11 @@ class Ui(Ui_Semesterapparat):
self.edit_faculty_member_title.setText(data[1]) self.edit_faculty_member_title.setText(data[1])
self.faculty_member_old_telnr.setText(data[6]) self.faculty_member_old_telnr.setText(data[6])
self.faculty_member_oldmail.setText(data[5]) self.faculty_member_oldmail.setText(data[5])
self.edit_faculty_member_title.setText(data[1]) if data[1] != None else self.edit_faculty_member_title.setText("") (
self.edit_faculty_member_title.setText(data[1])
if data[1] != None
else self.edit_faculty_member_title.setText("")
)
# self.edit_faculty_member_name.setText(f"{data[3]} {data[2]}") # self.edit_faculty_member_name.setText(f"{data[3]} {data[2]}")
# self.edit_faculty_member_title.setCurrentText(data[1]) # self.edit_faculty_member_title.setCurrentText(data[1])
@@ -374,7 +396,12 @@ class Ui(Ui_Semesterapparat):
# self.user_create_frame_error.setText("Der Nutzername ist bereits vergeben")#TODO: implement error message # self.user_create_frame_error.setText("Der Nutzername ist bereits vergeben")#TODO: implement error message
return return
userdata = AdminCommands().create_password(password) userdata = AdminCommands().create_password(password)
self.db.createUser(username=username, password=f"{userdata[1]}{userdata[0]}", salt=userdata[1], role=role) self.db.createUser(
username=username,
password=f"{userdata[1]}{userdata[0]}",
salt=userdata[1],
role=role,
)
self.user_create_frame_username.clear() self.user_create_frame_username.clear()
self.user_create_frame_password.clear() self.user_create_frame_password.clear()
self.user_frame_userrole.setCurrentText("") self.user_frame_userrole.setCurrentText("")
@@ -384,7 +411,9 @@ class Ui(Ui_Semesterapparat):
if self.user_delete_confirm.isChecked(): if self.user_delete_confirm.isChecked():
username = self.user_delete_frame_user_select.currentText() username = self.user_delete_frame_user_select.currentText()
self.db.deleteUser(username) self.db.deleteUser(username)
self.user_delete_frame_user_select.removeItem(self.user_delete_frame_user_select.currentIndex()) self.user_delete_frame_user_select.removeItem(
self.user_delete_frame_user_select.currentIndex()
)
self.user_delete_confirm.setChecked(False) self.user_delete_confirm.setChecked(False)
else: else:
# self.user_delete_err_message.setText("Bitte bestätigen Sie die Löschung des Nutzers") # TODO: implement error message # self.user_delete_err_message.setText("Bitte bestätigen Sie die Löschung des Nutzers") # TODO: implement error message
@@ -392,14 +421,22 @@ class Ui(Ui_Semesterapparat):
def update_user_data(self): def update_user_data(self):
username = self.user_edit_frame_user_select.currentText() username = self.user_edit_frame_user_select.currentText()
password = self.user_edit_frame_new_password.text() if self.user_edit_frame_new_password.text() != "" else None password = (
role = self.user_edit_frame_role_select.currentText() if self.user_edit_frame_role_select.currentText() != "" else None self.user_edit_frame_new_password.text()
if self.user_edit_frame_new_password.text() != ""
else None
)
role = (
self.user_edit_frame_role_select.currentText()
if self.user_edit_frame_role_select.currentText() != ""
else None
)
userdata = AdminCommands().create_password(password) userdata = AdminCommands().create_password(password)
data = { data = {
"password": f"{userdata[1]}{userdata[0]}", "password": f"{userdata[1]}{userdata[0]}",
"salt": userdata[1], "salt": userdata[1],
"role": role "role": role,
} }
data = {key: value for key, value in data.items() if value is not None} data = {key: value for key, value in data.items() if value is not None}
print(data) print(data)
@@ -418,19 +455,38 @@ class Ui(Ui_Semesterapparat):
return f"{data[2]} {fname}" return f"{data[2]} {fname}"
if fname != "" and lname != "": if fname != "" and lname != "":
return f"{lname} {fname}" return f"{lname} {fname}"
# get the data and use new value if it is not none and does not mach the old value # get the data and use new value if it is not none and does not mach the old value
if self.edit_faculty_member_select_member.currentText() == "": if self.edit_faculty_member_select_member.currentText() == "":
return return
olddata = self.db.getFacultyMember(self.edit_faculty_member_select_member.currentText()) olddata = self.db.getFacultyMember(
self.edit_faculty_member_select_member.currentText()
)
data = olddata[0] data = olddata[0]
oldlname = data[2] oldlname = data[2]
oldfname = data[1] oldfname = data[1]
# take data except first and last entry # take data except first and last entry
titel = self.edit_faculty_member_new_title.currentText() if self.edit_faculty_member_new_title.currentText() != "Kein Titel" else None titel = (
fname = self.edit_faculty_member_new_surname.text() if self.edit_faculty_member_new_surname.text() != "" else self.edit_faculty_member_select_member.currentText().split(" ")[1].strip() self.edit_faculty_member_new_title.currentText()
lname = self.user_faculty_member_new_name.text() if self.user_faculty_member_new_name.text() != "" else self.edit_faculty_member_select_member.currentText().split(" ")[0].strip() if self.edit_faculty_member_new_title.currentText() != "Kein Titel"
else None
)
fname = (
self.edit_faculty_member_new_surname.text()
if self.edit_faculty_member_new_surname.text() != ""
else self.edit_faculty_member_select_member.currentText()
.split(" ")[1]
.strip()
)
lname = (
self.user_faculty_member_new_name.text()
if self.user_faculty_member_new_name.text() != ""
else self.edit_faculty_member_select_member.currentText()
.split(" ")[0]
.strip()
)
fullname = __gen_fullname(fname, lname, data) fullname = __gen_fullname(fname, lname, data)
mail = self.user_faculty_member_new_telnr.text() mail = self.user_faculty_member_new_telnr.text()
telnr = self.user_faculty_member_new_mail.text() telnr = self.user_faculty_member_new_mail.text()
@@ -579,9 +635,7 @@ class Ui(Ui_Semesterapparat):
self.tableWidget.insertRow(0) self.tableWidget.insertRow(0)
self.tableWidget.setItem(0, 0, QtWidgets.QTableWidgetItem("")) self.tableWidget.setItem(0, 0, QtWidgets.QTableWidgetItem(""))
self.tableWidget.setItem(0, 1, QtWidgets.QTableWidgetItem(app[1])) self.tableWidget.setItem(0, 1, QtWidgets.QTableWidgetItem(app[1]))
self.tableWidget.setItem( self.tableWidget.setItem(0, 2, QtWidgets.QTableWidgetItem(str(app[4])))
0, 2, QtWidgets.QTableWidgetItem(str(app[4]))
)
self.tableWidget.setItem(0, 3, QtWidgets.QTableWidgetItem(app[2])) self.tableWidget.setItem(0, 3, QtWidgets.QTableWidgetItem(app[2]))
self.tableWidget.setItem(0, 4, QtWidgets.QTableWidgetItem(app[3])) self.tableWidget.setItem(0, 4, QtWidgets.QTableWidgetItem(app[3]))
# replace the 0 with a checkbox # replace the 0 with a checkbox
@@ -591,7 +645,9 @@ class Ui(Ui_Semesterapparat):
# if i[9] is 1, set the background of the row to red # if i[9] is 1, set the background of the row to red
if int(app[9]) == 1: if int(app[9]) == 1:
for j in range(5): for j in range(5):
self.tableWidget.item(0, j).setBackground(QtGui.QColor(235, 74, 71)) self.tableWidget.item(0, j).setBackground(
QtGui.QColor(235, 74, 71)
)
# disable the checkbox # disable the checkbox
self.tableWidget.cellWidget(0, 0).setEnabled(False) self.tableWidget.cellWidget(0, 0).setEnabled(False)
# set the tooltip # set the tooltip
@@ -654,9 +710,7 @@ class Ui(Ui_Semesterapparat):
apparats = [str(apparat) for apparat in apparats] apparats = [str(apparat) for apparat in apparats]
self.box_appnrs.addItems(apparats) self.box_appnrs.addItems(apparats)
persons = self.db.getProfs() persons = self.db.getProfs()
self.box_person.addItems( self.box_person.addItems([f"{person[3]}, {person[2]}" for person in persons])
[f"{person[3]}, {person[2]}" for person in persons]
)
self.box_fach.addItems(subject[1] for subject in self.db.getSubjects()) self.box_fach.addItems(subject[1] for subject in self.db.getSubjects())
semester = self.db.getSemersters() semester = self.db.getSemersters()
self.box_erstellsemester.addItems(semester) self.box_erstellsemester.addItems(semester)
@@ -669,9 +723,7 @@ class Ui(Ui_Semesterapparat):
self.tabWidget_3.removeTab(1) self.tabWidget_3.removeTab(1)
self.statistics_table.setRowCount(len(data)) self.statistics_table.setRowCount(len(data))
for i in range(len(data)): for i in range(len(data)):
self.statistics_table.setItem( self.statistics_table.setItem(i, 0, QtWidgets.QTableWidgetItem(data[i][0]))
i, 0, QtWidgets.QTableWidgetItem(data[i][0])
)
self.statistics_table.setItem( self.statistics_table.setItem(
i, 1, QtWidgets.QTableWidgetItem(str(data[i][1])) i, 1, QtWidgets.QTableWidgetItem(str(data[i][1]))
) )
@@ -730,32 +782,46 @@ class Ui(Ui_Semesterapparat):
self.db_err_message.setText("") self.db_err_message.setText("")
self.btn_del_select_apparats.setEnabled(True) self.btn_del_select_apparats.setEnabled(True)
params = { params = {
"appnr": self.box_appnrs.currentText() "appnr": (
self.box_appnrs.currentText()
if self.box_appnrs.currentText() != "" if self.box_appnrs.currentText() != ""
else None, else None
"prof_id": self.db.getProfId(self.box_person.currentText()) ),
"prof_id": (
self.db.getProfId(self.box_person.currentText())
if self.box_person.currentText() != "" if self.box_person.currentText() != ""
else None, else None
"fach": self.box_fach.currentText() ),
"fach": (
self.box_fach.currentText()
if self.box_fach.currentText() != "" if self.box_fach.currentText() != ""
else None, else None
"erstellsemester": self.box_erstellsemester.currentText() ),
"erstellsemester": (
self.box_erstellsemester.currentText()
if self.box_erstellsemester.currentText() != "" if self.box_erstellsemester.currentText() != ""
else None, else None
"dauer": "1" ),
"dauer": (
"1"
if self.box_dauerapp.currentText() == "Ja" if self.box_dauerapp.currentText() == "Ja"
else "0" else "0" if self.box_dauerapp.currentText() == "Nein" else None
if self.box_dauerapp.currentText() == "Nein" ),
else None, "endsemester": (
"endsemester": self.box_semester.currentText() self.box_semester.currentText()
if self.box_semester.currentText() != "" if self.box_semester.currentText() != ""
else None, else None
),
"deletable": "True" if self.check_deletable.isChecked() else None, "deletable": "True" if self.check_deletable.isChecked() else None,
"deletesemester": self.generateSemester(today=True), "deletesemester": self.generateSemester(today=True),
} }
params = {key: value for key, value in params.items() if value is not None} #remove empty lines to prevent errors params = {
key: value for key, value in params.items() if value is not None
} # remove empty lines to prevent errors
print(params) print(params)
params = {key: value for key, value in params.items() if value != "Alle"} #remove empty lines to prevent errors params = {
key: value for key, value in params.items() if value != "Alle"
} # remove empty lines to prevent errors
print(params) print(params)
result = self.db.statistic_request(**params) result = self.db.statistic_request(**params)
# add QTableWidgetItems to the table # add QTableWidgetItems to the table
@@ -1011,7 +1077,10 @@ class Ui(Ui_Semesterapparat):
def get_index_of_value(self, table_widget, value): def get_index_of_value(self, table_widget, value):
for i in range(table_widget.rowCount()): for i in range(table_widget.rowCount()):
for j in range(table_widget.columnCount()): for j in range(table_widget.columnCount()):
if table_widget.item(i, j) is not None and table_widget.item(i, j).text() == value: if (
table_widget.item(i, j) is not None
and table_widget.item(i, j).text() == value
):
return i, j return i, j
return None return None
@@ -1170,12 +1239,15 @@ class Ui(Ui_Semesterapparat):
def check_availability(self): def check_availability(self):
self.threadeds.clear() self.threadeds.clear()
def _update_progress(current, all_titles): def _update_progress(current, all_titles):
self.avail_status.setText("{}/{}".format(current, all_titles)) self.avail_status.setText("{}/{}".format(current, all_titles))
def _hide_progress_label(): def _hide_progress_label():
self.label_20.hide() self.label_20.hide()
self.avail_status.hide() self.avail_status.hide()
self.avail_status.setText("0/0") self.avail_status.setText("0/0")
# get all links from the table # get all links from the table
# if no index in tableWidget_apparat_media is selected, check all # if no index in tableWidget_apparat_media is selected, check all
if self.tableWidget_apparat_media.currentRow() == -1: if self.tableWidget_apparat_media.currentRow() == -1:
@@ -1307,6 +1379,7 @@ class Ui(Ui_Semesterapparat):
link = "https://" + link link = "https://" + link
webbrowser.open(link) webbrowser.open(link)
# get the name of the column # get the name of the column
columnname = self.tableWidget_apparat_media.horizontalHeaderItem( columnname = self.tableWidget_apparat_media.horizontalHeaderItem(
item.column() item.column()
@@ -1374,7 +1447,9 @@ class Ui(Ui_Semesterapparat):
path = path.resolve() path = path.resolve()
os.system(f"open {path}") os.system(f"open {path}")
else: else:
recreateFile(_selected_doc_name,self.active_apparat ,filetype=_selected_doc_filetype) recreateFile(
_selected_doc_name, self.active_apparat, filetype=_selected_doc_filetype
)
# # if ~ in path, replace it with the home directory # # if ~ in path, replace it with the home directory
# if "~" in path: # if "~" in path:
# path = path.replace("~", str(Path.home())) # path = path.replace("~", str(Path.home()))
@@ -1529,7 +1604,9 @@ class Ui(Ui_Semesterapparat):
signatures = [i for i in signatures if i != ""] signatures = [i for i in signatures if i != ""]
ic(signatures) ic(signatures)
print("starting thread") print("starting thread")
grabber = BookGrabber(mode = "ARRAY", app_id = app_id,prof_id = prof_id,data = signatures) grabber = BookGrabber(
mode="ARRAY", app_id=app_id, prof_id=prof_id, data=signatures
)
# grabber.mode = "ARRAY" # grabber.mode = "ARRAY"
# grabber.data = signatures # grabber.data = signatures
# grabber.app_id = app_id # grabber.app_id = app_id
@@ -1587,9 +1664,7 @@ class Ui(Ui_Semesterapparat):
appd = ApparatData() appd = ApparatData()
appd.appnr = self.active_apparat appd.appnr = self.active_apparat
appd.prof_title = ( appd.prof_title = (
None None if self.prof_title.text() == "" else self.prof_title.text()
if self.prof_title.text() == ""
else self.prof_title.text()
) )
appd.profname = self.drpdwn_prof_name.currentText() appd.profname = self.drpdwn_prof_name.currentText()
appd.appname = self.app_name.text() appd.appname = self.app_name.text()
@@ -1623,6 +1698,7 @@ class Ui(Ui_Semesterapparat):
def send_mail_preview(self): def send_mail_preview(self):
pass pass
@property @property
def active_apparat(self): def active_apparat(self):
return self.drpdwn_app_nr.currentText() return self.drpdwn_app_nr.currentText()
@@ -1639,7 +1715,11 @@ class Ui(Ui_Semesterapparat):
} }
) )
self.dokument_list.item(i, 2).setText("") self.dokument_list.item(i, 2).setText("")
self.db.insertFile(files, self.active_apparat, self.db.getProfId(self.drpdwn_prof_name.currentText())) self.db.insertFile(
files,
self.active_apparat,
self.db.getProfId(self.drpdwn_prof_name.currentText()),
)
def update_apparat_list(self): def update_apparat_list(self):
# get a list of new apparats based on self.apparats and self.old_apparats # get a list of new apparats based on self.apparats and self.old_apparats
@@ -1656,6 +1736,7 @@ class Ui(Ui_Semesterapparat):
def insert_apparat_into_table(self, apparat): def insert_apparat_into_table(self, apparat):
ic(apparat) ic(apparat)
def __dauer_check(apparat): def __dauer_check(apparat):
return "Ja" if apparat[7] == 1 else "Nein" return "Ja" if apparat[7] == 1 else "Nein"
@@ -1688,7 +1769,6 @@ class Ui(Ui_Semesterapparat):
) )
self.logger.log_info(f"Inserted apparat {apparat[4]}") self.logger.log_info(f"Inserted apparat {apparat[4]}")
def open_context_menu(self, position): def open_context_menu(self, position):
menu = QtWidgets.QMenu() menu = QtWidgets.QMenu()
extend_action = menu.addAction("Verlängern") extend_action = menu.addAction("Verlängern")
@@ -1741,9 +1821,7 @@ class Ui(Ui_Semesterapparat):
self.message_box.setText(message["message"]) self.message_box.setText(message["message"])
appnr = message["appnr"] appnr = message["appnr"]
appnr = "/" if appnr is None else str(appnr) appnr = "/" if appnr is None else str(appnr)
self.line_app_info.setText( self.line_app_info.setText(appnr)
appnr
)
def __delete_message(): def __delete_message():
message = messages[self.spin_select_message.value() - 1] message = messages[self.spin_select_message.value() - 1]
@@ -1754,7 +1832,6 @@ class Ui(Ui_Semesterapparat):
self.spin_select_message.setValue(1) self.spin_select_message.setValue(1)
self.label_total_day_messages.setText("/ " + str(len(messages))) self.label_total_day_messages.setText("/ " + str(len(messages)))
selected_date = self.calendarWidget.selectedDate().toString("yyyy-MM-dd") selected_date = self.calendarWidget.selectedDate().toString("yyyy-MM-dd")
print(selected_date) print(selected_date)
messages = self.db.getMessages(selected_date) messages = self.db.getMessages(selected_date)
@@ -1767,9 +1844,11 @@ class Ui(Ui_Semesterapparat):
self.message_frame.show() self.message_frame.show()
self.label_total_day_messages.setText("/ " + str(message_count)) self.label_total_day_messages.setText("/ " + str(message_count))
# if there is only one message, disable the spinbox # if there is only one message, disable the spinbox
self.spin_select_message.setEnabled( (
False self.spin_select_message.setEnabled(False)
) if message_count == 1 else self.spin_select_message.setEnabled(True) if message_count == 1
else self.spin_select_message.setEnabled(True)
)
self.spin_select_message.setValue(1) self.spin_select_message.setValue(1)
# load the first message # load the first message
__update_message() __update_message()
@@ -1819,7 +1898,11 @@ class Ui(Ui_Semesterapparat):
signature=book, signature=book,
prof_id=self.db.getProfId(self.drpdwn_prof_name.currentText()), prof_id=self.db.getProfId(self.drpdwn_prof_name.currentText()),
) )
book_id = self.db.getBookIdBasedOnSignature(self.active_apparat,self.db.getProfId(self.drpdwn_prof_name.currentText()),book) book_id = self.db.getBookIdBasedOnSignature(
self.active_apparat,
self.db.getProfId(self.drpdwn_prof_name.currentText()),
book,
)
widget = QtWidgets.QDialog() widget = QtWidgets.QDialog()
bookedit = edit_bookdata_ui() bookedit = edit_bookdata_ui()
bookedit.setupUi(widget) bookedit.setupUi(widget)
@@ -1880,6 +1963,7 @@ class Ui(Ui_Semesterapparat):
) )
self.db.deleteBook(book_id) self.db.deleteBook(book_id)
self.update_app_media_list() self.update_app_media_list()
def extend_apparat(self): def extend_apparat(self):
framework = QtWidgets.QDialog() framework = QtWidgets.QDialog()
frame = App_Ext_Dialog() frame = App_Ext_Dialog()
@@ -1937,7 +2021,12 @@ class Ui(Ui_Semesterapparat):
"general": general_data, "general": general_data,
} }
mail_prev = Mail_Dialog(app_id = self.active_apparat,data = pass_data,app_name = self.app_name.text(),app_subject = self.app_fach.currentText()) mail_prev = Mail_Dialog(
app_id=self.active_apparat,
data=pass_data,
app_name=self.app_name.text(),
app_subject=self.app_fach.currentText(),
)
mail_prev.setupUi(dialog) mail_prev.setupUi(dialog)
mail_prev.comboBox.addItems(mail_prevs) mail_prev.comboBox.addItems(mail_prevs)
mail_prev.set_mail() mail_prev.set_mail()
@@ -1951,9 +2040,7 @@ class Ui(Ui_Semesterapparat):
state = self.confirm_popup(message) state = self.confirm_popup(message)
print(state) print(state)
if state == 1: if state == 1:
self.db.deleteApparat( self.db.deleteApparat(selected_apparat_id, generateSemesterByDate())
selected_apparat_id, generateSemesterByDate()
)
# delete the corresponding entry from self.apparats # delete the corresponding entry from self.apparats
for apparat in self.apparats: for apparat in self.apparats:
if apparat[4] == int(selected_apparat_id): if apparat[4] == int(selected_apparat_id):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\plotdata.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\plotdata.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtWidgets from PySide6 import QtCore, QtWidgets
class Ui_MainWindow(object): class Ui_MainWindow(object):

View File

@@ -2,13 +2,13 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/SemesterapparatsManager/src/ui/semesterapparat_ui.ui' # Form implementation generated from reading ui file '/home/alexander/GitHub/SemesterapparatsManager/src/ui/semesterapparat_ui.ui'
# #
# Created by: PyQt6 UI code generator 5.15.10 # Created by: PySide6 UI code generator 5.15.10
# #
# WARNING: Any manual changes made to this file will be lost when pyuic5 is # WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object): class Ui_MainWindow(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\setupwizard.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\setupwizard.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_Wizard(object): class Ui_Wizard(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\edit_bookdata.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\edit_bookdata.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from src.logic.dataclass import BookData from src.logic.dataclass import BookData

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\fileparser.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\fileparser.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from src.logic.webrequest import BibTextTransformer, WebRequest from src.logic.webrequest import BibTextTransformer, WebRequest
@@ -61,7 +61,7 @@ class Ui_Dialog(object):
self.listWidget.setObjectName("listWidget") self.listWidget.setObjectName("listWidget")
self.signatures = [] self.signatures = []
self.returned = [] self.returned = []
# self.data_gathering_complete = QtCore.pyqtSignal() # self.data_gathering_complete = QtCore.Signal()
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)

View File

@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/login.ui' # Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/login.ui'
# #
# Created by: PyQt6 UI code generator 6.5.3 # Created by: PySide6 UI code generator 6.5.3
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
@@ -8,7 +8,7 @@
import hashlib import hashlib
from PyQt6 import QtCore, QtWidgets from PySide6 import QtCore, QtWidgets
from src.backend.database import Database from src.backend.database import Database
from src.backend.admin_console import AdminCommands from src.backend.admin_console import AdminCommands

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\mail_preview.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\mail_preview.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
import subprocess import subprocess
import tempfile import tempfile
import os import os

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\medianadder.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\medianadder.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Dialog(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\new_subject.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\new_subject.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtWidgets from PySide6 import QtCore, QtWidgets
class Ui_Dialog(object): class Ui_Dialog(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\parsed_titles.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\parsed_titles.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from src.logic.log import MyLogger from src.logic.log import MyLogger
from src.logic.threads import AutoAdder from src.logic.threads import AutoAdder

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\reminder.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\reminder.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Dialog(object):

View File

@@ -1,13 +1,13 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\settings.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\settings.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from omegaconf import OmegaConf from omegaconf import OmegaConf
from PyQt6 import QtCore, QtWidgets from PySide6 import QtCore, QtWidgets
config = OmegaConf.load("config.yaml") config = OmegaConf.load("config.yaml")

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'ui\dialogs\apparat_extend.ui' # Form implementation generated from reading ui file 'ui\dialogs\apparat_extend.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from src.backend.semester import generateSemesterByDate from src.backend.semester import generateSemesterByDate
class Ui_Dialog(object): class Ui_Dialog(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'ui/dialogs/extend_apparat.ui' # Form implementation generated from reading ui file 'ui/dialogs/extend_apparat.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_Frame(object): class Ui_Frame(object):

View File

@@ -1,7 +1,7 @@
import subprocess import subprocess
import tempfile import tempfile
import os import os
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from src.ui.dialogs.Ui_mail_preview import Ui_eMailPreview as Ui_Dialog from src.ui.dialogs.Ui_mail_preview import Ui_eMailPreview as Ui_Dialog
from omegaconf import OmegaConf from omegaconf import OmegaConf

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'ui\dialogs\mail_preview.ui' # Form implementation generated from reading ui file 'ui\dialogs\mail_preview.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Dialog(object):

View File

@@ -1,4 +1,4 @@
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from .Ui_medianadder import Ui_Dialog from .Ui_medianadder import Ui_Dialog

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/new_subject.ui' # Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/new_subject.ui'
# #
# Created by: PyQt6 UI code generator 6.5.3 # Created by: PySide6 UI code generator 6.5.3
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Dialog(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/parsed_titles.ui' # Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/parsed_titles.ui'
# #
# Created by: PyQt6 UI code generator 6.5.3 # Created by: PySide6 UI code generator 6.5.3
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_Form(object): class Ui_Form(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'ui\dialogs\confirm_extend.ui' # Form implementation generated from reading ui file 'ui\dialogs\confirm_extend.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_extend_confirm(object): class Ui_extend_confirm(object):

View File

@@ -1,5 +1,5 @@
from omegaconf import OmegaConf from omegaconf import OmegaConf
from PyQt6 import QtWidgets from PySide6 import QtWidgets
from src.ui.dialogs.Ui_settings import Ui_Dialog as _settings from src.ui.dialogs.Ui_settings import Ui_Dialog as _settings

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'untitled.ui' # Form implementation generated from reading ui file 'untitled.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object): class Ui_MainWindow(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/plotdata.ui' # Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/plotdata.ui'
# #
# Created by: PyQt6 UI code generator 6.5.3 # Created by: PySide6 UI code generator 6.5.3
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object): class Ui_MainWindow(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'ui/semesterapparat_ui.ui' # Form implementation generated from reading ui file 'ui/semesterapparat_ui.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object): class Ui_MainWindow(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/sounds/semesterapparat_ui.ui' # Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/sounds/semesterapparat_ui.ui'
# #
# Created by: PyQt6 UI code generator 6.5.3 # Created by: PySide6 UI code generator 6.5.3
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object): class Ui_MainWindow(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\widgets\message_widget.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\widgets\message_widget.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from src.backend.database import Database from src.backend.database import Database

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\widgets\progress_overview_widget.ui' # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\widgets\progress_overview_widget.ui'
# #
# Created by: PyQt6 UI code generator 6.3.1 # Created by: PySide6 UI code generator 6.3.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class Ui_Form(object): class Ui_Form(object):

View File

@@ -1,6 +1,6 @@
# import pysignal pyslot # import pysignal pyslot
from PyQt6.QtCore import pyqtSignal from PySide6.QtCore import Signal
from PyQt6.QtWidgets import ( from PySide6.QtWidgets import (
QApplication, QApplication,
QTreeWidget, QTreeWidget,
QTreeWidgetItem, QTreeWidgetItem,
@@ -10,7 +10,7 @@ from PyQt6.QtWidgets import (
class StatusWidget(QWidget): class StatusWidget(QWidget):
person_double_clicked = pyqtSignal(str,str, int) person_double_clicked = Signal(str,str, int)
def __init__(self, data, header_label: str): def __init__(self, data, header_label: str):
super(StatusWidget, self).__init__() super(StatusWidget, self).__init__()

View File

@@ -1,15 +1,15 @@
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class CollapsibleWidget(object): class CollapsibleWidget(object):
pass pass
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class CollapsibleWidget(object): class CollapsibleWidget(object):
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
class CollapsibleWidget(object): class CollapsibleWidget(object):

View File

@@ -1,5 +1,5 @@
from PyQt6.QtWidgets import QFileDialog, QApplication from PySide6.QtWidgets import QFileDialog, QApplication
from PyQt6.QtCore import QSettings from PySide6.QtCore import QSettings
import sys import sys
class FilePicker: class FilePicker:

View File

@@ -5,7 +5,7 @@ matplotlib.use("QtAgg")
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure from matplotlib.figure import Figure
from PyQt6 import QtCore, QtWidgets from PySide6 import QtCore, QtWidgets
class graph(FigureCanvas): class graph(FigureCanvas):

View File

@@ -1,4 +1,4 @@
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from Ui_progress_overview_widget import Ui_Form from Ui_progress_overview_widget import Ui_Form

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/SemesterapparatsManager/src/ui/widgets/webview.ui' # Form implementation generated from reading ui file '/home/alexander/GitHub/SemesterapparatsManager/src/ui/widgets/webview.ui'
# #
# Created by: PyQt6 UI code generator 6.6.1 # Created by: PySide6 UI code generator 6.6.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # 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. # run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
from PySide6 import QtWebEngineWidgets from PySide6 import QtWebEngineWidgets

View File

@@ -1,11 +1,13 @@
import sys
#from PyQt6 import Webview
from PySide6.QtWebEngineWidgets import QWebEngineView
import os import os
from PySide6.QtWidgets import QTabWidget import sys
# from PySide6 import Webview
from PySide6.QtWebEngineWidgets import QWebEngineView
from PySide6.QtWidgets import QApplication, QMainWindow, QTabWidget
documentation_path = "docs" documentation_path = "docs"
class DocumentationViewer(QMainWindow): class DocumentationViewer(QMainWindow):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
@@ -18,20 +20,29 @@ class DocumentationViewer(QMainWindow):
self.set_documentation_tabs() self.set_documentation_tabs()
def set_documentation_tabs(self): def set_documentation_tabs(self):
files = [os.path.join(documentation_path, file) for file in os.listdir(documentation_path) if file.endswith(".html")] files = [
os.path.join(documentation_path, file)
for file in os.listdir(documentation_path)
if file.endswith(".html")
]
for file in files: for file in files:
with open(file, "r") as f: with open(file, "r") as f:
html_content = f.read() html_content = f.read()
tab_name = os.path.basename(file).split(".")[0] tab_name = os.path.basename(file).split(".")[0]
self.load_documentation(tab_name, html_content) self.load_documentation(tab_name, html_content)
def load_documentation(self, tab_name="Documentation", html_content="<h1>Documentation</h1><p>Your HTML documentation content goes here.</p>"):
def load_documentation(
self,
tab_name="Documentation",
html_content="<h1>Documentation</h1><p>Your HTML documentation content goes here.</p>",
):
documentation_tab = QWebEngineView() documentation_tab = QWebEngineView()
documentation_tab.setHtml(html_content) documentation_tab.setHtml(html_content)
self.tabs.addTab(documentation_tab, tab_name) self.tabs.addTab(documentation_tab, tab_name)
if __name__ == "__main__": if __name__ == "__main__":
app = QApplication(sys.argv) app = QApplication(sys.argv)
viewer = DocumentationViewer() viewer = DocumentationViewer()
viewer.show() viewer.show()
sys.exit(app.exec()) sys.exit(app.exec())