files: reorganize imports, remove print lines
This commit is contained in:
@@ -10,8 +10,9 @@ import hashlib
|
||||
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
from src.backend.database import Database
|
||||
from src.backend.admin_console import AdminCommands
|
||||
from src.backend.database import Database
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
@@ -64,13 +65,11 @@ class Ui_Dialog(object):
|
||||
def login(self):
|
||||
username = self.lineEdit.text()
|
||||
password = self.lineEdit_2.text()
|
||||
print(type(username), password)
|
||||
# print(type(username), password)
|
||||
# Assuming 'Database' is a class to interact with your database
|
||||
db = Database()
|
||||
db = Database()
|
||||
|
||||
hashed_password = hashlib.sha256(
|
||||
password.encode()
|
||||
).hexdigest()
|
||||
hashed_password = hashlib.sha256(password.encode()).hexdigest()
|
||||
if len(db.getUsers()) == 0:
|
||||
AdminCommands().create_admin()
|
||||
self.lresult = 1 # Indicate successful login
|
||||
|
||||
@@ -6,17 +6,18 @@
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
import subprocess
|
||||
import tempfile
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
from omegaconf import OmegaConf
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
class Ui_eMailPreview(object):
|
||||
|
||||
class Ui_eMailPreview(object):
|
||||
def setupUi(
|
||||
self,
|
||||
eMailPreview,
|
||||
@@ -31,7 +32,10 @@ class Ui_eMailPreview(object):
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(eMailPreview)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(310, 630, 341, 32))
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayoutWidget = QtWidgets.QWidget(eMailPreview)
|
||||
self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 10, 661, 621))
|
||||
@@ -46,7 +50,11 @@ class Ui_eMailPreview(object):
|
||||
self.prof_name.setObjectName("prof_name")
|
||||
self.gridLayout.addWidget(self.prof_name, 2, 2, 1, 1)
|
||||
self.label_3 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignTop)
|
||||
self.label_3.setAlignment(
|
||||
QtCore.Qt.AlignmentFlag.AlignLeading
|
||||
| QtCore.Qt.AlignmentFlag.AlignLeft
|
||||
| QtCore.Qt.AlignmentFlag.AlignTop
|
||||
)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 5, 0, 1, 1)
|
||||
self.mail_name = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
@@ -81,7 +89,12 @@ class Ui_eMailPreview(object):
|
||||
self.gender_non = QtWidgets.QRadioButton(self.gridLayoutWidget)
|
||||
self.gender_non.setObjectName("gender_non")
|
||||
self.horizontalLayout_3.addWidget(self.gender_non)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
spacerItem = QtWidgets.QSpacerItem(
|
||||
40,
|
||||
20,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
)
|
||||
self.horizontalLayout_3.addItem(spacerItem)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_3, 4, 2, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
@@ -89,8 +102,8 @@ class Ui_eMailPreview(object):
|
||||
self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(eMailPreview)
|
||||
self.buttonBox.accepted.connect(eMailPreview.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(eMailPreview.reject) # type: ignore
|
||||
self.buttonBox.accepted.connect(eMailPreview.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(eMailPreview.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(eMailPreview)
|
||||
self._appid = app_id
|
||||
self._appname = app_name
|
||||
@@ -127,7 +140,6 @@ class Ui_eMailPreview(object):
|
||||
return "Sehr geehrte Frau"
|
||||
elif self.gender_non.isChecked():
|
||||
return "Guten Tag"
|
||||
|
||||
|
||||
def set_mail(self):
|
||||
email_template = self.comboBox.currentText()
|
||||
@@ -145,14 +157,19 @@ class Ui_eMailPreview(object):
|
||||
mail_html = mail_template.split("<html>")[1]
|
||||
mail_html = "<html>" + mail_html
|
||||
mail_html = mail_html.format(
|
||||
Profname=self.prof_name.text().split(" ")[1], Appname=self._appname, AppNr=self._appid, AppSubject = self._subject,greeting = self.get_greeting()
|
||||
Profname=self.prof_name.text().split(" ")[1],
|
||||
Appname=self._appname,
|
||||
AppNr=self._appid,
|
||||
AppSubject=self._subject,
|
||||
greeting=self.get_greeting(),
|
||||
)
|
||||
|
||||
self.mail_body.setHtml(mail_html)
|
||||
|
||||
def load_mail_templates(self):
|
||||
mail_templates = os.listdir("mail_vorlagen")
|
||||
mail_templates = [f for f in mail_templates if f.endswith(".eml")]
|
||||
print(mail_templates)
|
||||
# print(mail_templates)
|
||||
self.comboBox.addItems(mail_templates)
|
||||
|
||||
def save_mail(self):
|
||||
@@ -168,16 +185,17 @@ class Ui_eMailPreview(object):
|
||||
) as f:
|
||||
f.write(mail)
|
||||
self.mail_path = f.name
|
||||
print(self.mail_path)
|
||||
# print(self.mail_path)
|
||||
# open the file using thunderbird
|
||||
subprocess.Popen([f"{self.mail_path}"])
|
||||
# delete the file
|
||||
# os.remove(self.mail_path)
|
||||
|
||||
|
||||
def launch():
|
||||
app = QtWidgets.QApplication([])
|
||||
eMailPreview = QtWidgets.QDialog()
|
||||
ui = Ui_eMailPreview()
|
||||
ui.setupUi(eMailPreview, "1","Test","Biologie","Kirchner, Alexander")
|
||||
ui.setupUi(eMailPreview, "1", "Test", "Biologie", "Kirchner, Alexander")
|
||||
eMailPreview.show()
|
||||
app.exec()
|
||||
app.exec()
|
||||
|
||||
@@ -110,7 +110,7 @@ class Ui_Form(object):
|
||||
self.progressBar.setValue(value)
|
||||
|
||||
def thread_quit(self):
|
||||
print("Terminating thread")
|
||||
# print("Terminating thread")
|
||||
self.thread.terminate()
|
||||
self.thread.quit()
|
||||
self.thread.deleteLater()
|
||||
@@ -144,7 +144,7 @@ class Ui_Form(object):
|
||||
def determine_progress(self, signal):
|
||||
# check length of listWidget
|
||||
length = self.listWidget.count()
|
||||
print(f"Length of listWidget: {length}")
|
||||
# print(f"Length of listWidget: {length}")
|
||||
if length == 0:
|
||||
logger.log_info("AutoAdder finished")
|
||||
self.buttonBox.accepted.emit()
|
||||
|
||||
@@ -169,7 +169,7 @@ class Ui_Dialog(object):
|
||||
name = application.application
|
||||
file_type = application.extensions
|
||||
display_name = application.name
|
||||
print(name, file_type, display_name) #
|
||||
# print(name, file_type, display_name) #
|
||||
# create new item
|
||||
item = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item.setText(0, display_name)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from .dialog_sources.Ui_about import Ui_about
|
||||
from PySide6 import QtWidgets
|
||||
import PySide6
|
||||
from src import Icon, __version__, __author__
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src import Icon, __author__, __version__
|
||||
|
||||
from .dialog_sources.about_ui import Ui_about
|
||||
|
||||
|
||||
class About(QtWidgets.QDialog, Ui_about):
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from PySide6 import QtWidgets
|
||||
from .dialog_sources.Ui_apparat_extend import Ui_Dialog
|
||||
|
||||
from src import Icon
|
||||
|
||||
from .dialog_sources.apparat_extend_ui import Ui_Dialog
|
||||
|
||||
|
||||
class ApparatExtendDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(
|
||||
|
||||
@@ -2,7 +2,7 @@ from PySide6 import QtWidgets
|
||||
|
||||
from src.logic.dataclass import BookData
|
||||
|
||||
from .dialog_sources.Ui_edit_bookdata import Ui_Dialog
|
||||
from .dialog_sources.edit_bookdata_ui import Ui_Dialog
|
||||
|
||||
|
||||
class BookDataUI(QtWidgets.QDialog, Ui_Dialog):
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
from .dialog_sources.documentprint_ui import Ui_Dialog
|
||||
from PySide6 import QtWidgets, QtCore
|
||||
from src import Icon
|
||||
|
||||
from src.utils.richtext import SemapSchilder, SemesterDocument
|
||||
from src.backend import Semester, Database
|
||||
from natsort import natsorted
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src.backend import Database, Semester
|
||||
from src.utils.richtext import SemapSchilder, SemesterDocument
|
||||
|
||||
from .dialog_sources.documentprint_ui import Ui_Dialog
|
||||
|
||||
|
||||
class DocumentPrintDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
@@ -23,25 +24,25 @@ class DocumentPrintDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
# Ensure the signal is connected only once
|
||||
try:
|
||||
self.pushButton_2.clicked.disconnect()
|
||||
except TypeError:
|
||||
except (TypeError, RuntimeWarning):
|
||||
pass # Signal was not connected before
|
||||
self.pushButton_2.clicked.connect(self.on_pushButton_2_clicked)
|
||||
|
||||
try:
|
||||
self.pushButton.clicked.disconnect()
|
||||
except TypeError:
|
||||
except (TypeError, RuntimeWarning):
|
||||
pass
|
||||
self.pushButton.clicked.connect(self.on_pushButton_clicked)
|
||||
|
||||
try:
|
||||
self.btn_load_current_apparats.clicked.disconnect()
|
||||
except TypeError:
|
||||
except (TypeError, RuntimeWarning):
|
||||
pass
|
||||
self.btn_load_current_apparats.clicked.connect(self.load_current_clicked)
|
||||
|
||||
try:
|
||||
self.manualCheck.clicked.disconnect()
|
||||
except TypeError:
|
||||
except (TypeError, RuntimeWarning):
|
||||
pass
|
||||
self.manualCheck.clicked.connect(self.manual_request)
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from .dialog_sources.Ui_elsa_add_table_entry import Ui_Dialog
|
||||
from src.logic.webrequest import WebRequest, BibTextTransformer
|
||||
from src import Icon
|
||||
from PySide6 import QtWidgets
|
||||
from src.transformers.transformers import DictToTable
|
||||
|
||||
from src import Icon
|
||||
from src.logic.webrequest import BibTextTransformer, WebRequest
|
||||
from src.logic.zotero import ZoteroController
|
||||
from src.transformers.transformers import DictToTable
|
||||
|
||||
from .dialog_sources.elsa_add_table_entry_ui import Ui_Dialog
|
||||
|
||||
zot = ZoteroController()
|
||||
dtt = DictToTable()
|
||||
@@ -174,7 +176,7 @@ class ElsaAddEntry(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.stackedWidget.setCurrentIndex(3)
|
||||
|
||||
def search(self, pages=None):
|
||||
print("searching")
|
||||
# #print("searching")
|
||||
param = self.searchIdent.text()
|
||||
web = WebRequest()
|
||||
web.get_ppn(param)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from .dialog_sources.Ui_elsa_generator_confirm import Ui_Dialog
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from .dialog_sources.elsa_generator_confirm_ui import Ui_Dialog
|
||||
|
||||
|
||||
class ElsaGenConfirm(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(self, parent=None, data=None):
|
||||
|
||||
@@ -70,7 +70,7 @@ class LoginDialog(Ui_Dialog):
|
||||
def login(self):
|
||||
username = self.lineEdit.text()
|
||||
password = self.lineEdit_2.text()
|
||||
# print(type(username), password)
|
||||
# #print(type(username), password)
|
||||
# Assuming 'Database' is a class to interact with your database
|
||||
|
||||
hashed_password = hashlib.sha256(password.encode()).hexdigest()
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from .dialog_sources.medianadder_ui import Ui_Dialog
|
||||
from src import Icon
|
||||
|
||||
from .dialog_sources.medianadder_ui import Ui_Dialog
|
||||
|
||||
|
||||
class MedienAdder(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(self, parent=None):
|
||||
@@ -78,4 +79,4 @@ def launch_gui():
|
||||
dialog = MedienAdder()
|
||||
dialog.show()
|
||||
app.exec()
|
||||
# print(dialog.mode, dialog.data, dialog.result())
|
||||
# #print(dialog.mode, dialog.data, dialog.result())
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import sys
|
||||
|
||||
import loguru
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src import LOG_DIR
|
||||
from src.backend import AutoAdder
|
||||
|
||||
|
||||
from .dialog_sources.parsed_titles_ui import Ui_Form
|
||||
import loguru
|
||||
import sys
|
||||
from src import LOG_DIR
|
||||
|
||||
log = loguru.logger
|
||||
log.remove()
|
||||
log.add(sys.stdout, level="INFO")
|
||||
log.add(f"{LOG_DIR}/application.log", rotation="1 MB", retention="10 days")
|
||||
|
||||
|
||||
class ParsedTitles(QtWidgets.QWidget, Ui_Form):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
@@ -32,7 +34,7 @@ class ParsedTitles(QtWidgets.QWidget, Ui_Form):
|
||||
self.progressBar.setValue(value)
|
||||
|
||||
def worker_quit(self):
|
||||
# print("Terminating worker")
|
||||
# #print("Terminating worker")
|
||||
self.worker.terminate()
|
||||
self.worker.quit()
|
||||
self.worker.deleteLater()
|
||||
@@ -66,7 +68,7 @@ class ParsedTitles(QtWidgets.QWidget, Ui_Form):
|
||||
def determine_progress(self, signal):
|
||||
# check length of listWidget
|
||||
length = self.listWidget.count()
|
||||
# print(f"Length of listWidget: {length}")
|
||||
# #print(f"Length of listWidget: {length}")
|
||||
if length == 0:
|
||||
log.info("AutoAdder finished")
|
||||
self.buttonBox.accepted.emit()
|
||||
|
||||
@@ -10,7 +10,7 @@ from PySide6 import QtWidgets
|
||||
|
||||
from src import Icon
|
||||
|
||||
from .dialog_sources.Ui_confirm_extend import Ui_extend_confirm
|
||||
from .dialog_sources.confirm_extend_ui import Ui_extend_confirm
|
||||
|
||||
|
||||
class ConfirmDialog(QtWidgets.QDialog, Ui_extend_confirm):
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from src import Icon, settings
|
||||
from .dialog_sources.settings_ui import Ui_Dialog as _settings
|
||||
from src.ui.widgets.iconLine import IconWidget
|
||||
import loguru
|
||||
import sys
|
||||
from src import LOG_DIR
|
||||
|
||||
import loguru
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from src import LOG_DIR, Icon, settings
|
||||
from src.ui.widgets.iconLine import IconWidget
|
||||
|
||||
from .dialog_sources.settings_ui import Ui_Dialog as _settings
|
||||
|
||||
log = loguru.logger
|
||||
log.remove()
|
||||
@@ -12,7 +14,6 @@ log.add(sys.stdout, level="INFO")
|
||||
log.add(f"{LOG_DIR}/application.log", rotation="1 MB", retention="10 days")
|
||||
|
||||
|
||||
|
||||
base = """'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
|
||||
<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style
|
||||
@@ -220,7 +221,7 @@ class Settings(QtWidgets.QDialog, _settings):
|
||||
|
||||
for color in self.get_colors():
|
||||
settings.icons.colors[color] = self.get_colors()[color]
|
||||
# print(color)
|
||||
# #print(color)
|
||||
for icon in self.get_icons():
|
||||
settings.icons.icons[icon] = self.get_icons()[icon]
|
||||
|
||||
@@ -245,7 +246,7 @@ class Settings(QtWidgets.QDialog, _settings):
|
||||
|
||||
def save(self):
|
||||
config = self.return_data()
|
||||
# #print(config)
|
||||
# ##print(config)
|
||||
|
||||
config.save()
|
||||
self.accept()
|
||||
|
||||
@@ -43,9 +43,7 @@ class MessageCalendar(QtWidgets.QCalendarWidget):
|
||||
|
||||
def setMessages(self, messages: list[dict[str, Any]]):
|
||||
# remove all drawn circles
|
||||
|
||||
for message in messages:
|
||||
# print(message)
|
||||
# Convert the date string to a QDate object
|
||||
date = QDate.fromString(message["remind_at"], "yyyy-MM-dd")
|
||||
# Store the message for the date
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
from .widget_sources.admin_edit_prof_ui import Ui_Dialog #
|
||||
import sys
|
||||
|
||||
import loguru
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src.logic import Prof
|
||||
from src.backend import Database
|
||||
import loguru
|
||||
import sys
|
||||
from src import LOG_DIR
|
||||
from src.backend import Database
|
||||
from src.logic import Prof
|
||||
|
||||
from .widget_sources.admin_edit_prof_ui import Ui_Dialog #
|
||||
|
||||
log = loguru.logger
|
||||
log.remove()
|
||||
log.add(sys.stdout, level="INFO")
|
||||
log.add(f"{LOG_DIR}/application.log", rotation="1 MB", retention="10 days")
|
||||
|
||||
|
||||
|
||||
class EditProf(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(self):
|
||||
super(EditProf, self).__init__()
|
||||
@@ -55,11 +57,11 @@ class EditProf(QtWidgets.QDialog, Ui_Dialog):
|
||||
# get the selected member
|
||||
name = self.edit_faculty_member_select_member.currentText()
|
||||
fullname = name.replace(",", "")
|
||||
# print(fullname, name)
|
||||
# #print(fullname, name)
|
||||
# get the data for the selected member
|
||||
data = self.db.getProfByName(fullname)
|
||||
# set the data
|
||||
# print(data)
|
||||
# #print(data)
|
||||
if data is None:
|
||||
self.edit_faculty_member_title.setText("")
|
||||
self.faculty_member_old_telnr.setText("")
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from .widget_sources.admin_edit_user_ui import Ui_Dialog
|
||||
from PySide6 import QtWidgets
|
||||
from src.backend import Database
|
||||
from src.backend import AdminCommands
|
||||
|
||||
from src.backend import AdminCommands, Database
|
||||
|
||||
from .widget_sources.admin_edit_user_ui import Ui_Dialog
|
||||
|
||||
admin = AdminCommands()
|
||||
|
||||
@@ -51,7 +52,7 @@ class EditUser(QtWidgets.QDialog, Ui_Dialog):
|
||||
"role": role,
|
||||
}
|
||||
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.user_delete_frame_user_select.setCurrentText("")
|
||||
self.user_edit_frame_new_password.clear()
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
from .widget_sources.calendar_entry_ui import Ui_Dialog
|
||||
from PySide6 import QtWidgets
|
||||
from PySide6.QtCore import Signal
|
||||
from src.backend.database import Database
|
||||
|
||||
from src import Icon
|
||||
from src.backend.database import Database
|
||||
|
||||
from .widget_sources.calendar_entry_ui import Ui_Dialog
|
||||
|
||||
|
||||
class CalendarEntry(QtWidgets.QDialog, Ui_Dialog):
|
||||
@@ -36,12 +38,12 @@ class CalendarEntry(QtWidgets.QDialog, Ui_Dialog):
|
||||
|
||||
def delete_message(self):
|
||||
value = self.spin_select_message.value()
|
||||
# print(value)
|
||||
# #print(value)
|
||||
if value > 0:
|
||||
value = value - 1
|
||||
message = self.messages[value]
|
||||
id = self.__get_id(message)
|
||||
# print("id", id)
|
||||
# #print("id", id)
|
||||
# del self.messages[value - 1]
|
||||
self.spin_select_message.setMaximum(len(self.messages))
|
||||
self.message_box.clear()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# import pysignal pyslot
|
||||
from PySide6.QtCore import Signal as Signal
|
||||
from PySide6.QtWidgets import (
|
||||
QApplication,
|
||||
QTreeWidget,
|
||||
QTreeWidgetItem,
|
||||
QVBoxLayout,
|
||||
@@ -30,7 +29,7 @@ class StatusWidget(QWidget):
|
||||
while parent:
|
||||
parent_depth += 1
|
||||
parent = parent.parent()
|
||||
# print(parent_depth)
|
||||
# #print(parent_depth)
|
||||
# Emit the person_double_clicked signal with the name of the person and the parent depth
|
||||
self.person_double_clicked.emit(self.header, item.text(column), parent_depth)
|
||||
|
||||
@@ -61,17 +60,3 @@ class StatusWidget(QWidget):
|
||||
|
||||
# Make the action entry collapsible
|
||||
action_item.setExpanded(True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
data = {"test": {"test2": ["test3", "test4"]}}
|
||||
widget = StatusWidget(data, "test")
|
||||
|
||||
widget.show()
|
||||
# detect emit signal
|
||||
widget.person_double_clicked.connect(lambda x: print(x))
|
||||
|
||||
sys.exit(app.exec())
|
||||
|
||||
@@ -21,7 +21,7 @@ class FilePicker:
|
||||
files, _ = filepicker.getOpenFileNames(
|
||||
caption="Open file",
|
||||
dir=self.last_path,
|
||||
filter="Unterstützte Dateien (*.docx *.csv *.eml);;Word (*.docx);;CSV Files (*.csv);;Mail (*.eml)",
|
||||
filter="Unterstützte Dateien (*.docx *.csv *.eml );;Word (*.docx);;CSV Files (*.csv);;Mail (*.eml)",
|
||||
)
|
||||
if files:
|
||||
self.last_path = files[0]
|
||||
@@ -33,4 +33,4 @@ if __name__ == "__main__":
|
||||
app = QApplication(sys.argv)
|
||||
picker = FilePicker()
|
||||
files = picker.pick_files()
|
||||
# print(files)
|
||||
# #print(files)
|
||||
|
||||
@@ -2,12 +2,10 @@ import random
|
||||
import sys
|
||||
from typing import Any, Union
|
||||
|
||||
|
||||
import loguru
|
||||
from PySide6 import QtWidgets, QtCore, QtGui
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtGui import QPainter, QPen, QColor
|
||||
from PySide6.QtCharts import QChart, QChartView, QLineSeries, QValueAxis, QCategoryAxis
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PySide6.QtCharts import QCategoryAxis, QChart, QChartView, QLineSeries, QValueAxis
|
||||
from PySide6.QtGui import QColor, QPainter, QPen
|
||||
|
||||
from src import LOG_DIR
|
||||
from src.backend.semester import Semester
|
||||
@@ -34,6 +32,7 @@ def mergedicts(d1: dict[str, Any], d2: dict[str, Any]):
|
||||
res.update(d2_dict) # type: ignore
|
||||
return res
|
||||
|
||||
|
||||
class DataQtGraph(QtWidgets.QWidget):
|
||||
def __init__(
|
||||
self,
|
||||
@@ -72,8 +71,8 @@ class DataQtGraph(QtWidgets.QWidget):
|
||||
# get the index of the semester in x_data
|
||||
if semester in x_data:
|
||||
index = x_data.index(semester)
|
||||
print("index:", index)
|
||||
print(key, y_data[key])
|
||||
# print("index:", index)
|
||||
# print(key, y_data[key])
|
||||
data["y"].append(y_data[key][index])
|
||||
lst.append(data)
|
||||
# for key in y_data:
|
||||
@@ -110,7 +109,7 @@ class DataQtGraph(QtWidgets.QWidget):
|
||||
|
||||
self.chart.createDefaultAxes()
|
||||
for entry in lst:
|
||||
print("entry:", entry)
|
||||
# print("entry:", entry)
|
||||
entryseries = QLineSeries()
|
||||
for x_val, y_val in zip(entry["x"], entry["y"]):
|
||||
#
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import re
|
||||
|
||||
import darkdetect
|
||||
from PySide6 import QtGui
|
||||
import re
|
||||
from src import settings
|
||||
|
||||
from src import settings
|
||||
|
||||
config = settings.icons
|
||||
|
||||
|
||||
Reference in New Issue
Block a user