EXPERIMENTAL: switch from PyQt6 to PySide6
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
|
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):
|
|
||||||
super(BookGrabber, self).__init__(parent = None)
|
def __init__(self, app_id, prof_id, mode, data, parent=None):
|
||||||
self.is_Running = True
|
super(BookGrabber, self).__init__(parent=None)
|
||||||
|
self.is_Running = True
|
||||||
self.logger = MyLogger("Worker")
|
self.logger = MyLogger("Worker")
|
||||||
self.logger.log_info("Starting worker thread")
|
self.logger.log_info("Starting worker thread")
|
||||||
self.data = data
|
self.data = data
|
||||||
@@ -26,16 +28,14 @@ class BookGrabber(QThread):
|
|||||||
self.state = (self.app_id, self.prof_id, self.mode, self.data)
|
self.state = (self.app_id, self.prof_id, self.mode, self.data)
|
||||||
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
|
||||||
# self.mode = None
|
# self.mode = None
|
||||||
# self.data = None
|
# self.data = None
|
||||||
# self.book_id = None
|
# self.book_id = None
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
while self.is_Running:
|
while self.is_Running:
|
||||||
self.db = Database()
|
self.db = Database()
|
||||||
@@ -64,7 +64,7 @@ class BookGrabber(QThread):
|
|||||||
for rds_item in rds.items:
|
for rds_item in rds.items:
|
||||||
sign = rds_item.superlocation
|
sign = rds_item.superlocation
|
||||||
loc = rds_item.location
|
loc = rds_item.location
|
||||||
ic(sign,loc)
|
ic(sign, loc)
|
||||||
ic(rds_item)
|
ic(rds_item)
|
||||||
if self.app_id in sign or self.app_id in loc:
|
if self.app_id in sign or self.app_id in loc:
|
||||||
state = 1
|
state = 1
|
||||||
@@ -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__(
|
||||||
@@ -263,7 +266,6 @@ class MockAvailCheck:
|
|||||||
result.append((item.callnumber, state))
|
result.append((item.callnumber, state))
|
||||||
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
|
||||||
|
|||||||
@@ -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.dataclass import ApparatData, BookData, MailData,Subjects
|
from src.logic.csvparser import csv_to_list
|
||||||
|
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()
|
||||||
@@ -80,15 +84,16 @@ class Medien(medienadder_ui):
|
|||||||
# self.save_path.setText(self.settings.save_path)
|
# self.save_path.setText(self.settings.save_path)
|
||||||
# self.settings.save_settings()
|
# self.settings.save_settings()
|
||||||
class MyComboBox(QtWidgets.QComboBox):
|
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)
|
||||||
|
|
||||||
|
|
||||||
class MessageCalendar(QtWidgets.QCalendarWidget):
|
class MessageCalendar(QtWidgets.QCalendarWidget):
|
||||||
#Widget for MessageCalendar
|
# Widget for MessageCalendar
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.messages = {} # Dictionary to store dates with messages
|
self.messages = {} # Dictionary to store dates with messages
|
||||||
@@ -168,9 +173,9 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.tableWidget_apparate.setSortingEnabled(True)
|
self.tableWidget_apparate.setSortingEnabled(True)
|
||||||
# self.tableWidget_apparate.text
|
# self.tableWidget_apparate.text
|
||||||
self.actionEinstellungen.triggered.connect(self.open_settings)
|
self.actionEinstellungen.triggered.connect(self.open_settings)
|
||||||
#if help>documentation is clicked, open the documentation or shortcut is pressed
|
# if help>documentation is clicked, open the documentation or shortcut is pressed
|
||||||
self.actionDokumentation.triggered.connect(self.open_documentation)
|
self.actionDokumentation.triggered.connect(self.open_documentation)
|
||||||
|
|
||||||
# set validators
|
# set validators
|
||||||
self.sem_year.setText(str(QtCore.QDate.currentDate().year()))
|
self.sem_year.setText(str(QtCore.QDate.currentDate().year()))
|
||||||
self.prof_mail.setValidator(
|
self.prof_mail.setValidator(
|
||||||
@@ -275,7 +280,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
for apparat in self.apparats:
|
for apparat in self.apparats:
|
||||||
self.insert_apparat_into_table(apparat)
|
self.insert_apparat_into_table(apparat)
|
||||||
|
|
||||||
self.old_apparats = self.apparats #create a clone to compare against later
|
self.old_apparats = self.apparats # create a clone to compare against later
|
||||||
# if length of apparats changes, update box_apparats
|
# if length of apparats changes, update box_apparats
|
||||||
# if tab is changed, gather data needed
|
# if tab is changed, gather data needed
|
||||||
self.tabWidget.currentChanged.connect(self.tab_changed)
|
self.tabWidget.currentChanged.connect(self.tab_changed)
|
||||||
@@ -289,9 +294,11 @@ class Ui(Ui_Semesterapparat):
|
|||||||
# TODO:admin - change faculty
|
# TODO:admin - change faculty
|
||||||
self.select_action_box.addItem("")
|
self.select_action_box.addItem("")
|
||||||
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,16 +343,24 @@ 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
|
||||||
name = self.edit_faculty_member_select_member.currentText()
|
name = self.edit_faculty_member_select_member.currentText()
|
||||||
fullname = name.replace(",","")
|
fullname = name.replace(",", "")
|
||||||
print(fullname,name)
|
print(fullname, name)
|
||||||
# get the data for the selected member
|
# get the data for the selected member
|
||||||
data = self.db.getProfByName(fullname)
|
data = self.db.getProfByName(fullname)
|
||||||
# set the data
|
# set the data
|
||||||
@@ -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,61 +421,88 @@ 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)
|
||||||
self.db.updateUser(username=username,data = data)
|
self.db.updateUser(username=username, data=data)
|
||||||
self.user_edit_frame_user_select.setCurrentText("")
|
self.user_edit_frame_user_select.setCurrentText("")
|
||||||
self.user_edit_frame_new_password.clear()
|
self.user_edit_frame_new_password.clear()
|
||||||
self.user_edit_frame_role_select.setCurrentText("")
|
self.user_edit_frame_role_select.setCurrentText("")
|
||||||
|
|
||||||
def edit_faculty_member_action(self):
|
def edit_faculty_member_action(self):
|
||||||
def __gen_fullname(fname,lname,data):
|
def __gen_fullname(fname, lname, data):
|
||||||
if fname == "" and lname == "":
|
if fname == "" and lname == "":
|
||||||
return data[3]
|
return data[3]
|
||||||
if fname == ""and lname != "":
|
if fname == "" and lname != "":
|
||||||
return f"{lname} {data[1]}"
|
return f"{lname} {data[1]}"
|
||||||
if fname != "" and lname == "":
|
if fname != "" and lname == "":
|
||||||
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"
|
||||||
fullname = __gen_fullname(fname,lname,data)
|
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)
|
||||||
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()
|
||||||
new_data = {
|
new_data = {
|
||||||
"titel":titel,
|
"titel": titel,
|
||||||
"fname":fname,
|
"fname": fname,
|
||||||
"lname":lname,
|
"lname": lname,
|
||||||
"fullname":fullname,
|
"fullname": fullname,
|
||||||
"mail":mail,
|
"mail": mail,
|
||||||
"telnr":telnr,
|
"telnr": telnr,
|
||||||
}
|
}
|
||||||
new_data = {key: value for key, value in new_data.items() if value != ""}
|
new_data = {key: value for key, value in new_data.items() if value != ""}
|
||||||
self.db.updateFacultyMember(data = new_data,oldlname=oldlname,oldfname=oldfname)
|
self.db.updateFacultyMember(data=new_data, oldlname=oldlname, oldfname=oldfname)
|
||||||
self.add_faculty_member_data()
|
self.add_faculty_member_data()
|
||||||
self.edit_faculty_member_new_title.setCurrentText("")
|
self.edit_faculty_member_new_title.setCurrentText("")
|
||||||
self.edit_faculty_member_new_surname.clear()
|
self.edit_faculty_member_new_surname.clear()
|
||||||
self.user_faculty_member_new_name.clear()
|
self.user_faculty_member_new_name.clear()
|
||||||
self.user_faculty_member_new_telnr.clear()
|
self.user_faculty_member_new_telnr.clear()
|
||||||
self.user_faculty_member_new_mail.clear()
|
self.user_faculty_member_new_mail.clear()
|
||||||
@@ -465,7 +521,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
roles = list(dict.fromkeys(roles))
|
roles = list(dict.fromkeys(roles))
|
||||||
users = self.db.getUsers()
|
users = self.db.getUsers()
|
||||||
users = [user[2] for user in users]
|
users = [user[2] for user in users]
|
||||||
users.remove(self.active_user)
|
users.remove(self.active_user)
|
||||||
if "admin" in users:
|
if "admin" in users:
|
||||||
users.remove("admin")
|
users.remove("admin")
|
||||||
if action == "Nutzer anlegen":
|
if action == "Nutzer anlegen":
|
||||||
@@ -498,7 +554,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
faculty_members = self.db.getFacultyMembers()
|
faculty_members = self.db.getFacultyMembers()
|
||||||
names = [f"{member[5]}" for member in faculty_members]
|
names = [f"{member[5]}" for member in faculty_members]
|
||||||
self.edit_faculty_member_select_member.clear()
|
self.edit_faculty_member_select_member.clear()
|
||||||
self.edit_faculty_member_select_member.addItems(names)
|
self.edit_faculty_member_select_member.addItems(names)
|
||||||
self.edit_faculty_member_select_member.addItem("")
|
self.edit_faculty_member_select_member.addItem("")
|
||||||
self.edit_faculty_member_select_member.setCurrentText("")
|
self.edit_faculty_member_select_member.setCurrentText("")
|
||||||
|
|
||||||
@@ -561,7 +617,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
created_status.person_double_clicked.connect(self.open_apparat)
|
created_status.person_double_clicked.connect(self.open_apparat)
|
||||||
deleted_status.person_double_clicked.connect(self.open_apparat)
|
deleted_status.person_double_clicked.connect(self.open_apparat)
|
||||||
|
|
||||||
def open_apparat(self, header:str, apparat:str, parent_depth:int):
|
def open_apparat(self, header: str, apparat: str, parent_depth: int):
|
||||||
print(header)
|
print(header)
|
||||||
if header == "deleted" and parent_depth == 2:
|
if header == "deleted" and parent_depth == 2:
|
||||||
# TODO: warn message here
|
# TODO: warn message here
|
||||||
@@ -577,11 +633,9 @@ class Ui(Ui_Semesterapparat):
|
|||||||
# set the items 0 = clickable checkbox, 1 = appname, 2 = profname, 3 = fach
|
# set the items 0 = clickable checkbox, 1 = appname, 2 = profname, 3 = fach
|
||||||
# insert new row
|
# insert new row
|
||||||
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]))
|
||||||
)
|
)
|
||||||
@@ -695,11 +747,11 @@ class Ui(Ui_Semesterapparat):
|
|||||||
|
|
||||||
def tab_changed(self):
|
def tab_changed(self):
|
||||||
curr_tab = self.tabWidget.currentIndex()
|
curr_tab = self.tabWidget.currentIndex()
|
||||||
if curr_tab == 0: # create tab
|
if curr_tab == 0: # create tab
|
||||||
return
|
return
|
||||||
elif curr_tab == 1: # statistics tab
|
elif curr_tab == 1: # statistics tab
|
||||||
self.populate_tab()
|
self.populate_tab()
|
||||||
elif curr_tab == 2: #admin tab
|
elif curr_tab == 2: # admin tab
|
||||||
self.populate_admin_tab()
|
self.populate_admin_tab()
|
||||||
|
|
||||||
def populate_admin_tab(self):
|
def populate_admin_tab(self):
|
||||||
@@ -730,33 +782,47 @@ 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": (
|
||||||
if self.box_appnrs.currentText() != ""
|
self.box_appnrs.currentText()
|
||||||
else None,
|
if self.box_appnrs.currentText() != ""
|
||||||
"prof_id": self.db.getProfId(self.box_person.currentText())
|
else None
|
||||||
if self.box_person.currentText() != ""
|
),
|
||||||
else None,
|
"prof_id": (
|
||||||
"fach": self.box_fach.currentText()
|
self.db.getProfId(self.box_person.currentText())
|
||||||
if self.box_fach.currentText() != ""
|
if self.box_person.currentText() != ""
|
||||||
else None,
|
else None
|
||||||
"erstellsemester": self.box_erstellsemester.currentText()
|
),
|
||||||
if self.box_erstellsemester.currentText() != ""
|
"fach": (
|
||||||
else None,
|
self.box_fach.currentText()
|
||||||
"dauer": "1"
|
if self.box_fach.currentText() != ""
|
||||||
if self.box_dauerapp.currentText() == "Ja"
|
else None
|
||||||
else "0"
|
),
|
||||||
if self.box_dauerapp.currentText() == "Nein"
|
"erstellsemester": (
|
||||||
else None,
|
self.box_erstellsemester.currentText()
|
||||||
"endsemester": self.box_semester.currentText()
|
if self.box_erstellsemester.currentText() != ""
|
||||||
if self.box_semester.currentText() != ""
|
else None
|
||||||
else None,
|
),
|
||||||
|
"dauer": (
|
||||||
|
"1"
|
||||||
|
if self.box_dauerapp.currentText() == "Ja"
|
||||||
|
else "0" if self.box_dauerapp.currentText() == "Nein" else None
|
||||||
|
),
|
||||||
|
"endsemester": (
|
||||||
|
self.box_semester.currentText()
|
||||||
|
if self.box_semester.currentText() != ""
|
||||||
|
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)
|
||||||
|
params = {
|
||||||
|
key: value for key, value in params.items() if value != "Alle"
|
||||||
|
} # 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
|
|
||||||
print(params)
|
|
||||||
result = self.db.statistic_request(**params)
|
result = self.db.statistic_request(**params)
|
||||||
# add QTableWidgetItems to the table
|
# add QTableWidgetItems to the table
|
||||||
self.tableWidget.setRowCount(len(result))
|
self.tableWidget.setRowCount(len(result))
|
||||||
@@ -1011,17 +1077,20 @@ 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
|
||||||
|
|
||||||
def load_app_data(self,app_id=None):
|
def load_app_data(self, app_id=None):
|
||||||
print(type(app_id))
|
print(type(app_id))
|
||||||
if isinstance(app_id, str):
|
if isinstance(app_id, str):
|
||||||
# double click the tableWidget_apparate row with the given app_id
|
# double click the tableWidget_apparate row with the given app_id
|
||||||
row,column = self.get_index_of_value(self.tableWidget_apparate,app_id)
|
row, column = self.get_index_of_value(self.tableWidget_apparate, app_id)
|
||||||
# set the current index to the row
|
# set the current index to the row
|
||||||
self.tableWidget_apparate.setCurrentCell(row,0)
|
self.tableWidget_apparate.setCurrentCell(row, 0)
|
||||||
app_pos = self.tableWidget_apparate.currentIndex()
|
app_pos = self.tableWidget_apparate.currentIndex()
|
||||||
appnr = self.tableWidget_apparate.item(app_pos.row(), 0).text()
|
appnr = self.tableWidget_apparate.item(app_pos.row(), 0).text()
|
||||||
appname = self.tableWidget_apparate.item(app_pos.row(), 1).text()
|
appname = self.tableWidget_apparate.item(app_pos.row(), 1).text()
|
||||||
@@ -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()
|
||||||
@@ -1366,7 +1439,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
return
|
return
|
||||||
if not _selected_doc_location == "Database":
|
if not _selected_doc_location == "Database":
|
||||||
path = Path(_selected_doc_location)
|
path = Path(_selected_doc_location)
|
||||||
path:Path = path + "/" + _selected_doc_name
|
path: Path = path + "/" + _selected_doc_name
|
||||||
if os.getenv("OS") == "Windows_NT":
|
if os.getenv("OS") == "Windows_NT":
|
||||||
path = path.resolve()
|
path = path.resolve()
|
||||||
os.startfile(path)
|
os.startfile(path)
|
||||||
@@ -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()))
|
||||||
@@ -1508,7 +1583,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.dokument_list.currentRow(), 0
|
self.dokument_list.currentRow(), 0
|
||||||
).text()
|
).text()
|
||||||
if file_location == "Database":
|
if file_location == "Database":
|
||||||
file = recreateFile(file_name,app_id,file_type,open=False)
|
file = recreateFile(file_name, app_id, file_type, open=False)
|
||||||
else:
|
else:
|
||||||
self.add_files()
|
self.add_files()
|
||||||
if file_type == "pdf":
|
if file_type == "pdf":
|
||||||
@@ -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()
|
||||||
@@ -1620,9 +1695,10 @@ class Ui(Ui_Semesterapparat):
|
|||||||
__clear_fields()
|
__clear_fields()
|
||||||
if self.check_send_mail.isChecked():
|
if self.check_send_mail.isChecked():
|
||||||
self.contact_prof()
|
self.contact_prof()
|
||||||
|
|
||||||
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()
|
||||||
@@ -1635,11 +1711,15 @@ class Ui(Ui_Semesterapparat):
|
|||||||
"name": self.dokument_list.item(i, 0).text(),
|
"name": self.dokument_list.item(i, 0).text(),
|
||||||
"type": self.dokument_list.item(i, 1).text(),
|
"type": self.dokument_list.item(i, 1).text(),
|
||||||
"date": self.dokument_list.item(i, 2).text(),
|
"date": self.dokument_list.item(i, 2).text(),
|
||||||
"path": self.dokument_list.item(i, 3).text(),
|
"path": self.dokument_list.item(i, 3).text(),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
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]
|
||||||
@@ -1753,7 +1831,6 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.spin_select_message.setMaximum(len(messages))
|
self.spin_select_message.setMaximum(len(messages))
|
||||||
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)
|
||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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__()
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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__()
|
||||||
@@ -16,22 +18,31 @@ class DocumentationViewer(QMainWindow):
|
|||||||
self.setCentralWidget(self.tabs)
|
self.setCentralWidget(self.tabs)
|
||||||
|
|
||||||
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())
|
||||||
|
|
||||||
Reference in New Issue
Block a user