fix broken files after faulty update
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
from .bookdata import BookDataUI as edit_bookdata_ui
|
||||
from .login import LoginDialog as login_ui
|
||||
from .mail import Mail_Dialog
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
from .dialog_sources.Ui_about import Ui_about
|
||||
from PyQt6 import QtWidgets
|
||||
from PyQt6.QtCore import PYQT_VERSION_STR
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
|
||||
from PyQt6 import QtWidgets
|
||||
from .dialog_sources.Ui_apparat_extend import Ui_Dialog
|
||||
from src import Icon
|
||||
from src.backend import generateSemesterByDate, generateSemesterByOffset
|
||||
from src.backend import Semester
|
||||
class ApparatExtendDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
from src.logic.dataclass import BookData
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
from .dialog_sources.Ui_confirm_extend import Ui_extend_confirm
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\about.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\app_status.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\apparat_extend.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.7.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\confirm_extend.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.7.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\edit_bookdata.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\elsa_add_table_entry.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.7.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\elsa_generate_citation.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\elsa_generator_confirm.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\login.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\mail_preview.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.7.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\medianadder.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.7.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\newMailTemplateDesigner.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\parsed_titles.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\reminder.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\settings.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.7.1
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
from .dialog_sources.Ui_elsa_add_table_entry import Ui_Dialog
|
||||
from src.logic.webrequest import WebRequest, BibTextTransformer
|
||||
from src import Icon
|
||||
from PyQt6 import QtWidgets
|
||||
from src.transformers.transformers import DictToTable
|
||||
from src.logic.zotero import ZoteroController
|
||||
from icecream import ic
|
||||
|
||||
zot = ZoteroController()
|
||||
dtt = DictToTable()
|
||||
@@ -117,7 +117,7 @@ class ElsaAddEntry(QtWidgets.QDialog, Ui_Dialog):
|
||||
if table["type"] == "zs":
|
||||
book = zot.createBook(table["isbn"])
|
||||
res_key = zot.createJournalArticle(book, table)
|
||||
ic(book)
|
||||
logger.debug(book)
|
||||
a_lastname = table["section_author"].split(";")[0].strip().split(",")[0]
|
||||
a_firstname = table["section_author"].split(";")[0].strip().split(",")[1]
|
||||
author = f"{a_lastname}, {a_firstname[0]}"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
from .dialog_sources.Ui_elsa_generate_citation import Ui_Dialog
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
from .dialog_sources.Ui_elsa_generator_confirm import Ui_Dialog
|
||||
from PyQt6 import QtCore, QtWidgets, QtGui
|
||||
|
||||
|
||||
@@ -2,16 +2,15 @@ import hashlib
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src import Icon, logger
|
||||
from src.backend.admin_console import AdminCommands
|
||||
from src.backend.database import Database
|
||||
|
||||
from .dialog_sources.Ui_login import Ui_Dialog
|
||||
from src import MyLogger
|
||||
|
||||
|
||||
class LoginDialog(Ui_Dialog):
|
||||
def setupUi(self, Dialog):
|
||||
self.log = MyLogger("Login")
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(218, 190)
|
||||
self.dialog = Dialog
|
||||
@@ -76,16 +75,20 @@ class LoginDialog(Ui_Dialog):
|
||||
if self.db.login(username, hashed_password):
|
||||
self.lresult = 1 # Indicate successful login
|
||||
self.lusername = username
|
||||
logger.success(f"User {username} logged in.")
|
||||
self.dialog.accept()
|
||||
|
||||
else:
|
||||
# Credentials are invalid, display a warning
|
||||
if username == "" or password == "":
|
||||
logger.warning("Invalid username or password. Login failed.")
|
||||
warning_dialog = QtWidgets.QMessageBox()
|
||||
warning_dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
warning_dialog.setText("Please enter a username and password.")
|
||||
warning_dialog.setWindowTitle("Login Failed")
|
||||
warning_dialog.exec()
|
||||
else:
|
||||
logger.warning("Invalid username or password. Login failed.")
|
||||
warning_dialog = QtWidgets.QMessageBox()
|
||||
warning_dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
warning_dialog.setText(
|
||||
|
||||
@@ -4,14 +4,12 @@ import sys
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from src import Icon, settings as config
|
||||
from src.logic.log import MyLogger
|
||||
|
||||
|
||||
from .dialog_sources.Ui_mail_preview import Ui_eMailPreview as MailPreviewDialog
|
||||
from .mailTemplate import MailTemplateDialog
|
||||
|
||||
|
||||
logger = MyLogger("Mail")
|
||||
|
||||
empty_signature = """<!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
|
||||
@@ -52,7 +50,7 @@ class Mail_Dialog(QtWidgets.QDialog, MailPreviewDialog):
|
||||
# prof_name,
|
||||
)
|
||||
|
||||
logger.log_info("Setting up mail dialog")
|
||||
logger.info("Setting up mail dialog")
|
||||
self.appid = app_id
|
||||
self.appname = app_name
|
||||
self.subject = app_subject
|
||||
@@ -84,7 +82,7 @@ class Mail_Dialog(QtWidgets.QDialog, MailPreviewDialog):
|
||||
self.btn_okay.clicked.connect(self.createAndSendMail)
|
||||
|
||||
def open_new_template(self):
|
||||
logger.log_info("Opening new template dialog")
|
||||
logger.info("Opening new template dialog")
|
||||
# TODO: implement new mail template dialog
|
||||
dialog = MailTemplateDialog()
|
||||
dialog.exec()
|
||||
@@ -101,9 +99,9 @@ Tel.: 0761/682-778 | 07617682-545"""
|
||||
|
||||
def load_mail_templates(self):
|
||||
# print("loading mail templates")
|
||||
logger.log_info("Loading mail templates")
|
||||
logger.info("Loading mail templates")
|
||||
mail_templates = os.listdir("mail_vorlagen")
|
||||
logger.log_info(f"Mail templates: {mail_templates}")
|
||||
logger.info(f"Mail templates: {mail_templates}")
|
||||
for template in mail_templates:
|
||||
self.comboBox.addItem(template)
|
||||
|
||||
@@ -121,10 +119,10 @@ Tel.: 0761/682-778 | 07617682-545"""
|
||||
return f"Guten Tag {name},"
|
||||
|
||||
def set_mail(self):
|
||||
logger.log_info("Setting mail")
|
||||
logger.info("Setting mail")
|
||||
email_template = self.comboBox.currentText()
|
||||
if email_template == "":
|
||||
logger.log_debug("No mail template selected")
|
||||
logger.debug("No mail template selected")
|
||||
return
|
||||
with open(f"mail_vorlagen/{email_template}", "r", encoding="utf-8") as f:
|
||||
mail_template = f.read()
|
||||
@@ -147,10 +145,10 @@ Tel.: 0761/682-778 | 07617682-545"""
|
||||
)
|
||||
|
||||
self.mail_body.setHtml(mail_html)
|
||||
logger.log_info(f"Mail template set to {email_template}")
|
||||
logger.info(f"Mail template set to {email_template}")
|
||||
|
||||
def createAndSendMail(self):
|
||||
logger.log_info("Sending mail")
|
||||
logger.info("Sending mail")
|
||||
import smtplib
|
||||
import ssl
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
@@ -188,7 +186,7 @@ Tel.: 0761/682-778 | 07617682-545"""
|
||||
# print("Mail sent")
|
||||
# end active process
|
||||
server.quit()
|
||||
logger.log_info("Mail sent, closing connection to server and dialog")
|
||||
logger.info("Mail sent, closing connection to server and dialog")
|
||||
# close the dialog
|
||||
|
||||
self.accept()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
import os
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'ui\dialogs\mail_preview.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from src import MyLogger
|
||||
|
||||
from .dialog_sources.Ui_medianadder import Ui_Dialog
|
||||
from src import Icon
|
||||
class MedienAdder(QtWidgets.QDialog, Ui_Dialog):
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# 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
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
from src.logic import AutoAdder
|
||||
from src.logic.log import MyLogger
|
||||
|
||||
|
||||
from .dialog_sources.Ui_parsed_titles import Ui_Form
|
||||
|
||||
logger = MyLogger("AutoTitleAdder")
|
||||
|
||||
|
||||
class ParsedTitles(QtWidgets.QWidget, Ui_Form):
|
||||
def __init__(self, parent=None):
|
||||
@@ -35,7 +33,7 @@ class ParsedTitles(QtWidgets.QWidget, Ui_Form):
|
||||
self.worker = None
|
||||
|
||||
def start(self):
|
||||
logger.log_info("Starting AutoAdder")
|
||||
logger.info("Starting AutoAdder")
|
||||
|
||||
self.worker = AutoAdder(
|
||||
data=self.signatures,
|
||||
@@ -54,8 +52,8 @@ class ParsedTitles(QtWidgets.QWidget, Ui_Form):
|
||||
self.worker.start()
|
||||
|
||||
def on_completion(self):
|
||||
logger.log_info("AutoAdder finished")
|
||||
logger.log_info("Returning data")
|
||||
logger.info("AutoAdder finished")
|
||||
logger.info("Returning data")
|
||||
|
||||
# create a function that closes the dialog
|
||||
|
||||
@@ -64,7 +62,7 @@ class ParsedTitles(QtWidgets.QWidget, Ui_Form):
|
||||
length = self.listWidget.count()
|
||||
# print(f"Length of listWidget: {length}")
|
||||
if length == 0:
|
||||
logger.log_info("AutoAdder finished")
|
||||
logger.info("AutoAdder finished")
|
||||
self.buttonBox.accepted.emit()
|
||||
|
||||
def update_lists(self, signal):
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# 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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'ui\dialogs\confirm_extend.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
from .dialog_sources.Ui_reminder import Ui_Erinnerung as Ui_Dialog
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from src import Icon, settings
|
||||
from .dialog_sources.Ui_settings import Ui_Dialog as _settings
|
||||
|
||||
Reference in New Issue
Block a user