rest of files, not sorted
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
|
||||
version: 0.1
|
||||
cli:
|
||||
version: 1.20.0
|
||||
version: 1.22.1
|
||||
plugins:
|
||||
sources:
|
||||
- id: trunk
|
||||
ref: v1.4.3
|
||||
ref: v1.5.0
|
||||
uri: https://github.com/trunk-io/plugins
|
||||
runtimes:
|
||||
enabled:
|
||||
@@ -25,15 +25,15 @@ lint:
|
||||
- trivy
|
||||
- trufflehog
|
||||
enabled:
|
||||
- osv-scanner@1.6.2
|
||||
- sql-formatter@15.2.0
|
||||
- sqlfluff@2.3.5
|
||||
- osv-scanner@1.7.2
|
||||
- sql-formatter@15.3.1
|
||||
- sqlfluff@3.0.6
|
||||
- isort@5.13.2
|
||||
- ruff@0.2.2
|
||||
- bandit@1.7.7
|
||||
- markdownlint@0.39.0
|
||||
- ruff@0.4.3
|
||||
- bandit@1.7.8
|
||||
- markdownlint@0.40.0
|
||||
- yamllint@1.35.1
|
||||
- black@24.2.0
|
||||
- black@24.4.2
|
||||
actions:
|
||||
disabled:
|
||||
- trunk-fmt-pre-commit
|
||||
|
||||
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -15,7 +15,9 @@
|
||||
"**/.pytest_cache": true,
|
||||
".pytest_cache": true,
|
||||
"**/__pycache__": true,
|
||||
"__pycache__": true
|
||||
"__pycache__": true,
|
||||
"**/.trunk": true,
|
||||
"**/.vscode": true
|
||||
},
|
||||
"explorerExclude.backup": {},
|
||||
"python.testing.unittestEnabled": false,
|
||||
|
||||
69
build.app.json
Normal file
69
build.app.json
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"version": "auto-py-to-exe-configuration_v1",
|
||||
"pyinstallerOptions": [
|
||||
{
|
||||
"optionDest": "noconfirm",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"optionDest": "filenames",
|
||||
"value": "C:/Users/aky547/GitHub/SemesterapparatsManager/__main__.py"
|
||||
},
|
||||
{
|
||||
"optionDest": "onefile",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"optionDest": "console",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"optionDest": "icon_file",
|
||||
"value": "C:/Users/aky547/Downloads/VZjRNn1k.ico"
|
||||
},
|
||||
{
|
||||
"optionDest": "name",
|
||||
"value": "SemesterAppMan"
|
||||
},
|
||||
{
|
||||
"optionDest": "clean_build",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"optionDest": "strip",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"optionDest": "noupx",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"optionDest": "disable_windowed_traceback",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"optionDest": "uac_admin",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"optionDest": "uac_uiaccess",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"optionDest": "argv_emulation",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"optionDest": "bootloader_ignore_signals",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"optionDest": "datas",
|
||||
"value": "C:/Users/aky547/GitHub/SemesterapparatsManager/config.yaml;."
|
||||
}
|
||||
],
|
||||
"nonPyinstallerOptions": {
|
||||
"increaseRecursionLimit": true,
|
||||
"manualArguments": ""
|
||||
}
|
||||
}
|
||||
12
config.yaml
12
config.yaml
@@ -30,9 +30,9 @@ database:
|
||||
path: ~\Desktop\semap\db\
|
||||
tempdir: ~\Desktop\semap\db\temp\
|
||||
mail:
|
||||
smtp_server:
|
||||
port:
|
||||
sender:
|
||||
user_name:
|
||||
use_user_name:
|
||||
password:
|
||||
smtp_server: smtp.ph-freiburg.de
|
||||
port: 465
|
||||
sender: alexander.kirchner@ph-freiburg.de
|
||||
user_name: aky547
|
||||
use_user_name: 1
|
||||
password: CMcDna3qPh2*n
|
||||
|
||||
@@ -10,10 +10,9 @@ apparat.subject = "Physik"
|
||||
apparat.semester = "SoSe 2021"
|
||||
|
||||
|
||||
files = {"name": "test.png", "type": "png",
|
||||
"path": r"C:\Users\aky547\Desktop\test.png"}
|
||||
files = {"name": "test.png", "type": "png", "path": r"C:\Users\aky547\Desktop\test.png"}
|
||||
db = Database()
|
||||
# print(db.recreate_file("testfile.pdf",files,3))
|
||||
# db.insert_file(files,3)
|
||||
# recreate_file("test.pdf",files,1))#insert_file(files,1))
|
||||
db.get_apparats_name(70)
|
||||
db.get_apparats_name(70)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from omegaconf import OmegaConf
|
||||
|
||||
from codebase import Database
|
||||
from codebase.pickles import load_pickle, make_pickle
|
||||
from omegaconf import OmegaConf
|
||||
from webrequest import BibTextTransformer, WebRequest
|
||||
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
BIN
dbfunctions
Normal file
BIN
dbfunctions
Normal file
Binary file not shown.
4266
docs - Kopie/database.html
Normal file
4266
docs - Kopie/database.html
Normal file
File diff suppressed because it is too large
Load Diff
327
docs - Kopie/database.md
Normal file
327
docs - Kopie/database.md
Normal file
@@ -0,0 +1,327 @@
|
||||
Module database
|
||||
===============
|
||||
|
||||
Classes
|
||||
-------
|
||||
|
||||
`Database(db_path: str = None)`
|
||||
: Initialize the database and create the tables if they do not exist.
|
||||
|
||||
Default constructor for the database class
|
||||
|
||||
Args:
|
||||
db_path (str, optional): Optional Path for testing / specific purposes. Defaults to None.
|
||||
|
||||
### Methods
|
||||
|
||||
`addBookToDatabase(self, bookdata: src.logic.dataclass.BookData, app_id: str, prof_id: str)`
|
||||
: Add books to the database. Both app_id and prof_id are required to add the book to the database, as the app_id and prof_id are used to select the books later on.
|
||||
|
||||
Args:
|
||||
bookdata (BookData): The metadata of the book to be added
|
||||
app_id (str): The apparat id where the book should be added to
|
||||
prof_id (str): The id of the professor where the book should be added to.
|
||||
|
||||
`addMessage(self, message: dict, user, appnr)`
|
||||
:
|
||||
|
||||
`changePassword(self, user, new_password)`
|
||||
:
|
||||
|
||||
`checkApparatExists(self, apparat_name)`
|
||||
:
|
||||
|
||||
`checkApparatExistsById(self, apparat_id)`
|
||||
:
|
||||
|
||||
`checkUsername(self, user)`
|
||||
:
|
||||
|
||||
`close_connection(self, conn: sqlite3.Connection)`
|
||||
: closes the connection to the database
|
||||
|
||||
Args:
|
||||
----
|
||||
- conn (sql.Connection): the connection to be closed
|
||||
|
||||
`connect(self) ‑> sqlite3.Connection`
|
||||
: Connect to the database
|
||||
|
||||
Returns:
|
||||
sql.Connection: The active connection to the database
|
||||
|
||||
`createApparat(self, apparat: src.logic.dataclass.ApparatData) ‑> Union[src.errors.DatabaseErrors.AppPresentError, ForwardRef(None), int]`
|
||||
:
|
||||
|
||||
`createProf(self, prof_details: dict)`
|
||||
:
|
||||
|
||||
`createUser(self, user, password, role, salt)`
|
||||
: Create a user based on passed data.
|
||||
|
||||
Args:
|
||||
----
|
||||
- username (str): Username to be used
|
||||
- password (str): the salted password
|
||||
- role (str): Role of the user
|
||||
- salt (str): a random salt for the user
|
||||
|
||||
`create_tables(self)`
|
||||
: Create the tables in the database
|
||||
|
||||
`deleteApparat(self, appnr, semester)`
|
||||
:
|
||||
|
||||
`deleteBook(self, book_id)`
|
||||
: Delete a book from the database
|
||||
|
||||
Args:
|
||||
book_id (str): ID of the book
|
||||
|
||||
`deleteMessage(self, message_id)`
|
||||
:
|
||||
|
||||
`deleteUser(self, user)`
|
||||
:
|
||||
|
||||
`getAllAparats(self, deleted=0)`
|
||||
:
|
||||
|
||||
`getApparatCountBySemester(self) ‑> tuple[list[str], list[int]]`
|
||||
:
|
||||
|
||||
`getApparatData(self, appnr, appname) ‑> src.logic.dataclass.ApparatData`
|
||||
:
|
||||
|
||||
`getApparatId(self, apparat_name)`
|
||||
:
|
||||
|
||||
`getApparatName(self, app_id, prof_id)`
|
||||
:
|
||||
|
||||
`getApparatsByProf(self, prof_id: int) ‑> list[tuple]`
|
||||
:
|
||||
|
||||
`getApparatsBySemester(self, semester: str) ‑> dict`
|
||||
:
|
||||
|
||||
`getBlob(self, filename, app_id)`
|
||||
: Get a blob from the database
|
||||
|
||||
Args:
|
||||
filename (str): The name of the file
|
||||
app_id (str): ID of the apparat
|
||||
|
||||
Returns:
|
||||
bytes: The file stored in
|
||||
|
||||
`getBook(self, book_id: int) ‑> src.logic.dataclass.BookData`
|
||||
: Get the book based on the id in the database
|
||||
|
||||
Args:
|
||||
book_id (int): The id of the book
|
||||
|
||||
Returns:
|
||||
BookData: The metadata of the book wrapped in a BookData object
|
||||
|
||||
`getBookBasedOnSignature(self, app_id: str, prof_id: str, signature: str) ‑> src.logic.dataclass.BookData`
|
||||
: Get the book based on the signature of the book.
|
||||
|
||||
Args:
|
||||
app_id (str): The apparat id the book should be associated with
|
||||
prof_id (str): The professor id the book should be associated with
|
||||
signature (str): The signature of the book
|
||||
|
||||
Returns:
|
||||
BookData: The total metadata of the book wrapped in a BookData object
|
||||
|
||||
`getBookId(self, bookdata: src.logic.dataclass.BookData, app_id, prof_id) ‑> int`
|
||||
: Get the id of a book based on the metadata of the book
|
||||
|
||||
Args:
|
||||
bookdata (BookData): The wrapped metadata of the book
|
||||
app_id (str): The apparat id the book should be associated with
|
||||
prof_id (str): The professor id the book should be associated with
|
||||
|
||||
Returns:
|
||||
int: ID of the book
|
||||
|
||||
`getBookIdBasedOnSignature(self, app_id: str, prof_id: str, signature: str) ‑> int`
|
||||
: Get a book id based on the signature of the book.
|
||||
|
||||
Args:
|
||||
app_id (str): The apparat id the book should be associated with
|
||||
prof_id (str): The professor id the book should be associated with
|
||||
signature (str): The signature of the book
|
||||
|
||||
Returns:
|
||||
int: The id of the book
|
||||
|
||||
`getBooks(self, app_id, prof_id, deleted=0) ‑> list[dict[int, src.logic.dataclass.BookData, int]]`
|
||||
: Get the Books based on the apparat id and the professor id
|
||||
|
||||
Args:
|
||||
app_id (str): The ID of the apparat
|
||||
prof_id (str): The ID of the professor
|
||||
deleted (int, optional): The state of the book. Set to 1 to include deleted ones. Defaults to 0.
|
||||
|
||||
Returns:
|
||||
list[dict[int, BookData, int]]: A list of dictionaries containing the id, the metadata of the book and the availability of the book
|
||||
|
||||
`getFacultyMember(self, name: str)`
|
||||
:
|
||||
|
||||
`getFacultyMembers(self)`
|
||||
:
|
||||
|
||||
`getFiles(self, app_id: int, prof_id: int) ‑> list[tuple]`
|
||||
:
|
||||
|
||||
`getLastBookId(self) ‑> int`
|
||||
: Get the last book id in the database
|
||||
|
||||
Returns:
|
||||
int: ID of the last book in the database
|
||||
|
||||
`getMessages(self, date: str)`
|
||||
:
|
||||
|
||||
`getProfByName(self, prof_name: str)`
|
||||
:
|
||||
|
||||
`getProfData(self, profname: str)`
|
||||
:
|
||||
|
||||
`getProfId(self, prof_name: str)`
|
||||
: getProfId _summary_
|
||||
|
||||
:param prof_name: _description_
|
||||
:type prof_name: str
|
||||
:return: _description_
|
||||
:rtype: _type_
|
||||
|
||||
`getProfNameById(self, prof_id: int, add_title: bool = False)`
|
||||
:
|
||||
|
||||
`getProfs(self)`
|
||||
:
|
||||
|
||||
`getRole(self, user)`
|
||||
:
|
||||
|
||||
`getRoles(self)`
|
||||
:
|
||||
|
||||
`getSemersters(self)`
|
||||
:
|
||||
|
||||
`getSpecificProfData(self, prof_id: int, fields: List[str])`
|
||||
: getSpecificProfData _summary_
|
||||
|
||||
|
||||
|
||||
Args:
|
||||
----
|
||||
- prof_id (int): _description_
|
||||
- fields (List[str]): _description_
|
||||
|
||||
Returns:
|
||||
-------
|
||||
- _type_: _description_
|
||||
|
||||
`getSubjects(self)`
|
||||
:
|
||||
|
||||
`getTitleById(self, prof_id: int)`
|
||||
:
|
||||
|
||||
`getUnavailableApparatNumbers(self) ‑> List[int]`
|
||||
: getUnavailableApparatNumbers returns a list of all currently used ApparatNumbers
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
-------
|
||||
- number(List[int]): a list of all currently used apparat numbers
|
||||
|
||||
`getUser(self)`
|
||||
:
|
||||
|
||||
`getUsers(self)`
|
||||
:
|
||||
|
||||
`get_db_contents(self) ‑> Optional[List[Tuple]]`
|
||||
: Get the contents of the
|
||||
|
||||
Returns:
|
||||
Union[List[Tuple], None]: _description_
|
||||
|
||||
`insertFile(self, file: list[dict], app_id: int, prof_id)`
|
||||
:
|
||||
|
||||
`insertInto(self, query: str, params: Tuple) ‑> None`
|
||||
: Insert sent data into the database
|
||||
|
||||
Args:
|
||||
query (str): The query to be executed
|
||||
params (Tuple): the parameters to be inserted into the database
|
||||
|
||||
`isEternal(self, id)`
|
||||
:
|
||||
|
||||
`login(self, user, hashed_password)`
|
||||
:
|
||||
|
||||
`query_db(self, query: str, args: Tuple = (), one: bool = False) ‑> Union[Tuple, List[Tuple]]`
|
||||
: Query the Database for the sent query.
|
||||
|
||||
Args:
|
||||
query (str): The query to be executed
|
||||
args (Tuple, optional): The arguments for the query. Defaults to ().
|
||||
one (bool, optional): Return the first result only. Defaults to False.
|
||||
|
||||
Returns:
|
||||
Union[Typle|List[Tuple]]: Returns the result of the query
|
||||
|
||||
`recreateFile(self, filename, app_id, filetype)`
|
||||
:
|
||||
|
||||
`searchBook(self, data: dict[str, str]) ‑> list[tuple[src.logic.dataclass.BookData, int]]`
|
||||
: Search a book in the database based on the sent data.
|
||||
|
||||
Args:
|
||||
data (dict[str, str]): A dictionary containing the data to be searched for. The dictionary can contain the following:
|
||||
- signature: The signature of the book
|
||||
- title: The title of the book
|
||||
|
||||
Returns:
|
||||
list[tuple[BookData, int]]: A list of tuples containing the wrapped Metadata and the id of the book
|
||||
|
||||
`setAvailability(self, book_id: str, available: str)`
|
||||
: Set the availability of a book in the database
|
||||
|
||||
Args:
|
||||
book_id (str): The id of the book
|
||||
available (str): The availability of the book
|
||||
|
||||
`setNewSemesterDate(self, appnr, newDate, dauerapp=False)`
|
||||
:
|
||||
|
||||
`statistic_request(self, **kwargs: Any)`
|
||||
:
|
||||
|
||||
`updateApparat(self, apparat_data: src.logic.dataclass.ApparatData)`
|
||||
:
|
||||
|
||||
`updateBookdata(self, book_id, bookdata: src.logic.dataclass.BookData)`
|
||||
: Update the bookdata in the database
|
||||
|
||||
Args:
|
||||
book_id (str): The id of the book
|
||||
bookdata (BookData): The new metadata of the book
|
||||
|
||||
`updateFacultyMember(self, data, oldlname, oldfname)`
|
||||
:
|
||||
|
||||
`updateUser(self, username, data: dict[str, str])`
|
||||
:
|
||||
132
docs - Kopie/db.html
Normal file
132
docs - Kopie/db.html
Normal file
@@ -0,0 +1,132 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.10.0" />
|
||||
<title>db API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>db</code></h1>
|
||||
</header>
|
||||
<section>
|
||||
<p>Module <code>db</code> provides the database schema for the semesterapparat application.</p>
|
||||
</section>
|
||||
<section id="section-intro">
|
||||
<details class="source" open="">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">CREATE_TABLE_APPARAT = """CREATE TABLE semesterapparat (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
name TEXT,
|
||||
prof_id INTEGER,
|
||||
fach TEXT,
|
||||
appnr INTEGER,
|
||||
erstellsemester TEXT,
|
||||
verlängert_am TEXT,
|
||||
dauer BOOLEAN,
|
||||
verlängerung_bis TEXT,
|
||||
deletion_status INTEGER,
|
||||
deleted_date TEXT,
|
||||
apparat_id_adis INTEGER,
|
||||
prof_id_adis INTEGER,
|
||||
konto INTEGER REFERENCES app_kontos (id),
|
||||
FOREIGN KEY (prof_id) REFERENCES prof (id)
|
||||
)"""
|
||||
CREATE_TABLE_MEDIA = """CREATE TABLE media (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
bookdata BLOB,
|
||||
app_id INTEGER,
|
||||
prof_id INTEGER,
|
||||
deleted INTEGER DEFAULT (0),
|
||||
available BOOLEAN,
|
||||
reservation BOOLEAN,
|
||||
FOREIGN KEY (prof_id) REFERENCES prof (id),
|
||||
FOREIGN KEY (app_id) REFERENCES semesterapparat (id)
|
||||
)"""
|
||||
CREATE_TABLE_APPKONTOS = """CREATE TABLE app_kontos (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
app_id INTEGER,
|
||||
konto INTEGER,
|
||||
passwort TEXT,
|
||||
FOREIGN KEY (app_id) REFERENCES semesterapparat (id)
|
||||
)"""
|
||||
CREATE_TABLE_FILES = """CREATE TABLE files (
|
||||
id INTEGER PRIMARY KEY,
|
||||
filename TEXT,
|
||||
fileblob BLOB,
|
||||
app_id INTEGER,
|
||||
filetyp TEXT,
|
||||
prof_id INTEGER REFERENCES prof (id),
|
||||
FOREIGN KEY (app_id) REFERENCES semesterapparat (id)
|
||||
)"""
|
||||
CREATE_TABLE_MESSAGES = """CREATE TABLE messages (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
created_at date NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
message TEXT NOT NULL,
|
||||
remind_at date NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
user_id INTEGER NOT NULL,
|
||||
appnr INTEGER,
|
||||
FOREIGN KEY (user_id) REFERENCES user (id)
|
||||
)"""
|
||||
CREATE_TABLE_PROF = """CREATE TABLE prof (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
titel TEXT,
|
||||
fname TEXT,
|
||||
lname TEXT,
|
||||
fullname TEXT NOT NULL UNIQUE,
|
||||
mail TEXT,
|
||||
telnr TEXT
|
||||
)"""
|
||||
CREATE_TABLE_USER = """CREATE TABLE user (
|
||||
id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
username TEXT NOT NULL UNIQUE,
|
||||
password TEXT NOT NULL,
|
||||
salt TEXT NOT NULL,
|
||||
role TEXT NOT NULL,
|
||||
email TEXT UNIQUE,
|
||||
name TEXT
|
||||
)"""
|
||||
CREATE_TABLE_SUBJECTS = """CREATE TABLE subjects (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
name TEXT NOT NULL UNIQUE
|
||||
)"""</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
0
docs - Kopie/db.md
Normal file
0
docs - Kopie/db.md
Normal file
18
docs - Kopie/index.md
Normal file
18
docs - Kopie/index.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Welcome to MkDocs
|
||||
|
||||
For full documentation visit [mkdocs.org](https://www.mkdocs.org).
|
||||
|
||||
## Commands
|
||||
|
||||
* `mkdocs new [dir-name]` - Create a new project.
|
||||
* `mkdocs serve` - Start the live-reloading docs server.
|
||||
* `mkdocs build` - Build the documentation site.
|
||||
* `mkdocs -h` - Print help message and exit.
|
||||
|
||||
## Project layout
|
||||
|
||||
mkdocs.yml # The configuration file.
|
||||
docs/
|
||||
index.md # The documentation homepage.
|
||||
database.md # Documentation of the Database and it's tables
|
||||
... # Other markdown pages, images and other files.
|
||||
3071
documentation/database.html
Normal file
3071
documentation/database.html
Normal file
File diff suppressed because it is too large
Load Diff
34
mail.py
Normal file
34
mail.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import sys
|
||||
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
from src.ui.dialogs.mail import Mail_Dialog
|
||||
|
||||
|
||||
def launch_gui(app_id="", app_name="", app_subject="", prof_name="", prof_mail=""):
|
||||
QtWidgets.QApplication([""])
|
||||
|
||||
dialog = Mail_Dialog(
|
||||
app_id=app_id,
|
||||
app_name=app_name,
|
||||
app_subject=app_subject,
|
||||
prof_name=prof_name,
|
||||
prof_mail=prof_mail,
|
||||
# default_mail="Information bezüglich der Auflösung des Semesterapparates",
|
||||
)
|
||||
dialog.exec()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app_id = "123"
|
||||
app_name = "Test"
|
||||
app_subject = "TestFach"
|
||||
prof_name = "Test"
|
||||
prof_mail = "kirchneralexander020@gmail.com"
|
||||
launch_gui(
|
||||
app_id=app_id,
|
||||
app_name=app_name,
|
||||
app_subject=app_subject,
|
||||
prof_name=prof_name,
|
||||
prof_mail=prof_mail,
|
||||
)
|
||||
@@ -1,54 +0,0 @@
|
||||
Message-ID: <987b46cf-2d8b-4a27-acb3-c50f61d3d85d@ph-freiburg.de>
|
||||
Date: Tue, 31 Oct 2023 11:38:34 +0100
|
||||
MIME-Version: 1.0
|
||||
User-Agent: Mozilla Thunderbird
|
||||
From: Alexander Kirchner <alexander.kirchner@ph-freiburg.de>
|
||||
Subject: =?UTF-8?Q?Information_bez=C3=BCglich_der_Aufl=C3=B6sung_des_Semeste?=
|
||||
=?UTF-8?Q?rapparates_=7BAppNr=7D?=
|
||||
Content-Language: de-DE
|
||||
X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0;
|
||||
attachmentreminder=0; deliveryformat=0
|
||||
X-Identity-Key: id1
|
||||
Fcc: imap://aky547@imap.ph-freiburg.de/INBOX/Sent
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
<p>Sehr geehrte/r {Profname}, <br>
|
||||
</p>
|
||||
<p><br>
|
||||
</p>
|
||||
auf die E-Mail bezüglich der Auflösung oder Verlängerung der
|
||||
Semesterapparate haben wir von Ihnen keine Rückmeldung erhalten.
|
||||
Deshalb gehen wir davon aus, dass der Apparat aufgelöst werden kann.
|
||||
Die Medien, die im Apparat aufgestellt waren, werden nun wieder
|
||||
regulär ausleihbar und sind dann an ihren Standorten bei den Fächern
|
||||
zu finden. <br>
|
||||
<br>
|
||||
Falls Sie den Apparat erneut, oder einen neuen Apparat anlegen
|
||||
wollen, können Sie mir das ausgefüllte Formular zur Einrichtung des
|
||||
Apparates (<a class="moz-txt-link-freetext"
|
||||
href="https://www.ph-freiburg.de/bibliothek/lernen/semesterapparate/info-lehrende-sem.html">https://www.ph-freiburg.de/bibliothek/lernen/semesterapparate/info-lehrende-sem.html</a>)
|
||||
zukommen lassen. Im Falle einer Verlängerung des Apparates reicht
|
||||
eine Antwort auf diese Mail.
|
||||
<p><br>
|
||||
</p>
|
||||
<p>Bei Fragen können Sie sich jederzeit an mich wenden.<br>
|
||||
</p>
|
||||
<p><br>
|
||||
</p>
|
||||
<pre class="moz-signature" cols="72">--
|
||||
Freundliche Grüße
|
||||
|
||||
Alexander Kirchner
|
||||
|
||||
|
||||
Bibliothek der Pädagogischen Hochschule Freiburg
|
||||
Tel. 0761/682-778</pre>
|
||||
</body>
|
||||
</html>
|
||||
@@ -20,7 +20,7 @@ Content-Transfer-Encoding: 8bit
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
<p>Sehr geehrte/r Herr/Frau {Profname}, <br>
|
||||
<p>{greeting} <br>
|
||||
</p>
|
||||
<p><br>
|
||||
</p>
|
||||
@@ -51,4 +51,4 @@ Alexander Kirchner
|
||||
Bibliothek der Pädagogischen Hochschule Freiburg
|
||||
Tel. 0761/682-778</pre>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@@ -18,7 +18,7 @@ Content-Transfer-Encoding: 8bit
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
<p>{greeting} {Profname}, <br>
|
||||
<p>{greeting} <br>
|
||||
</p>
|
||||
<p><br>
|
||||
</p>
|
||||
|
||||
57
open_file_test.py
Normal file
57
open_file_test.py
Normal file
@@ -0,0 +1,57 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from omegaconf import OmegaConf
|
||||
|
||||
from src.backend.database import Database
|
||||
|
||||
db = Database()
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
|
||||
def main():
|
||||
_selected_doc_name = "sap71.csv"
|
||||
_selected_doc_location = "Database"
|
||||
_selected_doc_filetype = "csv"
|
||||
print(_selected_doc_name, _selected_doc_filetype)
|
||||
if not _selected_doc_location == "Database":
|
||||
path = Path(_selected_doc_location)
|
||||
path: Path = path + "/" + _selected_doc_name
|
||||
if os.getenv("OS") == "Windows_NT":
|
||||
path = path.resolve()
|
||||
os.startfile(path)
|
||||
else:
|
||||
path = path.resolve()
|
||||
os.system(f"open {path}")
|
||||
else:
|
||||
try:
|
||||
_selected_doc_name = db.recreateFile(
|
||||
_selected_doc_name, "71", filetype=_selected_doc_filetype
|
||||
)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
path = config.database.tempdir + _selected_doc_name
|
||||
# if ~ in path, replace it with the home directory
|
||||
if "~" in path:
|
||||
path = path.replace("~", str(Path.home()))
|
||||
path = Path(path)
|
||||
if os.getenv("OS") == "Windows_NT":
|
||||
path = path.resolve()
|
||||
os.startfile(path)
|
||||
else:
|
||||
path = path.resolve()
|
||||
os.system(f"open {path}")
|
||||
# filebytes = self.db.get_blob(
|
||||
# _selected_doc_name,
|
||||
# self.active_apparat(),
|
||||
# )
|
||||
# # use io.BytesIO to create a file-like object from the bytes and open it in the respective program
|
||||
# file = io.BytesIO(filebytes)
|
||||
# file.name = _selected_doc_name
|
||||
|
||||
# QtGui.QDesktopServices.openUrl(QtCore.QUrl(file))
|
||||
# print(type(filebytes))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
16
resources.qrc
Normal file
16
resources.qrc
Normal file
@@ -0,0 +1,16 @@
|
||||
<RCC>
|
||||
<qresource prefix="icons">
|
||||
<file>resources/logo_SAP.ico</file>
|
||||
<file>resources/logo_SAP.png</file>
|
||||
<file>resources/1f4e7.svg</file>
|
||||
<file>resources/1f510.svg</file>
|
||||
<file>resources/2795.svg</file>
|
||||
<file>resources/VZjRNn1k.ico</file>
|
||||
</qresource>
|
||||
<qresource prefix="notifications">
|
||||
<file>resources/critical.png</file>
|
||||
<file>resources/information.png</file>
|
||||
<file>resources/question.png</file>
|
||||
<file>resources/warning.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -1,8 +1,11 @@
|
||||
import os
|
||||
from omegaconf import OmegaConf
|
||||
from pathlib import Path
|
||||
|
||||
from omegaconf import OmegaConf
|
||||
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
|
||||
def delete_temp_contents():
|
||||
"""
|
||||
delete_temp_contents deletes the contents of the temp directory.
|
||||
@@ -16,7 +19,7 @@ def delete_temp_contents():
|
||||
os.remove(os.path.join(root, file))
|
||||
for dir in dirs:
|
||||
os.rmdir(os.path.join(root, dir))
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
delete_temp_contents()
|
||||
delete_temp_contents()
|
||||
|
||||
16
src/backend/import pyautogui.py
Normal file
16
src/backend/import pyautogui.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import time
|
||||
|
||||
import pyautogui
|
||||
|
||||
|
||||
def main():
|
||||
key_count = input("How many keys do you have? ")
|
||||
key = pyautogui.RIGHT
|
||||
for _i in range(int(key_count)):
|
||||
pyautogui.keyDown(key)
|
||||
pyautogui.keyUp(key)
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
753
src/backend/olddatabase.py
Normal file
753
src/backend/olddatabase.py
Normal file
@@ -0,0 +1,753 @@
|
||||
import datetime
|
||||
import os
|
||||
|
||||
# from src.data import pickles
|
||||
import pickle
|
||||
import re
|
||||
import shutil
|
||||
import sqlite3 as sql3
|
||||
import tempfile
|
||||
from typing import Any
|
||||
|
||||
from omegaconf import OmegaConf
|
||||
|
||||
from src.logic.constants import SEMAP_MEDIA_ACCOUNTS
|
||||
from src.logic.dataclass import ApparatData, BookData
|
||||
from src.logic.log import MyLogger
|
||||
|
||||
# from icecream import ic
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
logger = MyLogger("Database")
|
||||
|
||||
|
||||
class Database:
|
||||
logger.log_info("Database imported")
|
||||
|
||||
def __init__(self) -> None:
|
||||
# TODO: change path later on to a variable based on the settings
|
||||
self.database_path = f"{config.database.path}{config.database.name}"
|
||||
# ic(self.database_path)
|
||||
self.database_path = "sap.db"
|
||||
logger.log_info("Connecting to database")
|
||||
self.database = sql3.connect(self.database_path)
|
||||
self.cur = self.database.cursor()
|
||||
|
||||
pass
|
||||
|
||||
def create_database(self):
|
||||
# create database from template
|
||||
subjects = config.subjects
|
||||
for subject in subjects:
|
||||
self.cur.execute(f"INSERT INTO subjects (name) VALUES ('{subject}')")
|
||||
self.database.commit()
|
||||
|
||||
def create_blob(self, file):
|
||||
with open(file, "rb") as f:
|
||||
blob = f.read()
|
||||
return blob
|
||||
|
||||
def recreate_file(self, filename, app_id: int):
|
||||
blob = self.get_blob(filename, app_id)
|
||||
# write the blob to the file and save it to a preset destination
|
||||
# with open(filename, "wb") as f:
|
||||
# f.write(blob)
|
||||
# use tempfile to create a temporary file
|
||||
if not os.path.exists(config.database.tempdir):
|
||||
os.mkdir(config.database.tempdir)
|
||||
tempfile.NamedTemporaryFile(
|
||||
filename=filename, delete=False, dir=config.database.tempdir, mode="wb"
|
||||
).write(blob)
|
||||
|
||||
# user = os.getlogin()
|
||||
# home = os.path.expanduser("~")
|
||||
|
||||
# # check if the folder exists, if not, create it
|
||||
# if not os.path.exists(f"{home}/Desktop/SemApp/{user}"):
|
||||
# os.mkdir(f"{home}/Desktop/SemApp/{user}")
|
||||
# shutil.move(filename, f"{home}/Desktop/SemApp/{user}")
|
||||
|
||||
def get_blob(self, filename: str, app_id: int):
|
||||
query = f"SELECT fileblob FROM files WHERE filename='{filename}' AND app_id={app_id}"
|
||||
logger.log_info(f"Retrieving blob for {filename}, Appid {app_id} from database")
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def get_kto_no(self, app_id: int):
|
||||
query = f"SELECT konto FROM semesterapparat WHERE id={app_id}"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def insert_file(self, file: list[dict], app_id: int, prof_id):
|
||||
for f in file:
|
||||
filename = f["name"]
|
||||
path = f["path"]
|
||||
filetyp = f["type"]
|
||||
print(f"filename: {filename}, path: {path}, filetyp: {filetyp}")
|
||||
if path == "Database":
|
||||
continue
|
||||
blob = self.create_blob(path)
|
||||
|
||||
query = "INSERT OR IGNORE INTO files (filename, fileblob, app_id, filetyp,prof_id) VALUES (?, ?, ?, ?,?)"
|
||||
params = (filename, blob, app_id, filetyp, prof_id)
|
||||
self.cur.execute(query, params)
|
||||
logger.log_info(
|
||||
f"Inserted {len(file)} file(s) of Apparat {app_id} into database"
|
||||
)
|
||||
self.database.commit()
|
||||
|
||||
def get_files(self, app_id: int, prof_id: int):
|
||||
query = f"SELECT filename, filetyp FROM files WHERE app_id={app_id} AND prof_id={prof_id}"
|
||||
result: list[tuple] = self.cur.execute(query).fetchall()
|
||||
return result
|
||||
|
||||
def get_prof_name_by_id(self, id, add_title: bool = False):
|
||||
if add_title is True:
|
||||
query = f"SELECT titel, fname, lname FROM prof WHERE id={id}"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
name = " ".join(result[0:3])
|
||||
return name
|
||||
else:
|
||||
query = f"SELECT fullname FROM prof WHERE id={id}"
|
||||
print(query)
|
||||
result = self.cur.execute(query).fetchone()
|
||||
name = result[0]
|
||||
return name
|
||||
|
||||
def get_prof_id(self, profname: str):
|
||||
query = f"SELECT id FROM prof WHERE fullname='{profname.replace(',', '')}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
if result is None:
|
||||
return None
|
||||
return self.cur.execute(query).fetchone()[0]
|
||||
|
||||
def get_app_id(self, appname: str):
|
||||
query = f"SELECT id FROM semesterapparat WHERE name='{appname}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
if result is None:
|
||||
return None
|
||||
return self.cur.execute(query).fetchone()[0]
|
||||
|
||||
def get_profs(self):
|
||||
query = "select * from prof"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def app_exists(self, appnr: str) -> bool:
|
||||
query = f"SELECT appnr FROM semesterapparat WHERE appnr='{appnr}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
if result is None:
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_prof_data(self, profname: str = None, id: int = None) -> dict[str, str]:
|
||||
if profname is not None:
|
||||
profname = profname.replace(",", "")
|
||||
profname = re.sub(r"\s+", " ", profname).strip()
|
||||
if id:
|
||||
query = "Select prof_id FROM semesterapparat WHERE appnr=?"
|
||||
params = (id,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
id = result[0]
|
||||
query = (
|
||||
f"SELECT * FROM prof WHERE fullname='{profname}'"
|
||||
if id is None
|
||||
else f"SELECT * FROM prof WHERE id={id}"
|
||||
)
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return_data = {
|
||||
"prof_title": result[1],
|
||||
"profname": f"{result[3], result[2]}",
|
||||
"prof_mail": result[5],
|
||||
"prof_tel": result[6],
|
||||
"id": result[0],
|
||||
}
|
||||
print(return_data)
|
||||
# select the entry that contains the first name
|
||||
return return_data
|
||||
|
||||
def set_new_sem_date(self, appnr, new_sem_date, dauerapp=False):
|
||||
# Todo: use extend_semester in new release
|
||||
date = datetime.datetime.now().strftime("%Y-%m-%d")
|
||||
|
||||
query = f"UPDATE semesterapparat SET verlängert_am='{date}', verlängerung_bis='{new_sem_date}' WHERE appnr='{appnr}'"
|
||||
if dauerapp is not False:
|
||||
query = f"UPDATE semesterapparat SET verlängert_am='{date}', verlängerung_bis='{new_sem_date}', dauerapp='{dauerapp} WHERE appnr='{appnr}'"
|
||||
self.cur.execute(query)
|
||||
|
||||
self.database.commit()
|
||||
|
||||
def create_apparat(self, ApparatData: ApparatData):
|
||||
prof_id = self.get_prof_id(ApparatData.profname)
|
||||
app_id = self.get_app_id(ApparatData.appname)
|
||||
if app_id is None:
|
||||
if prof_id is None:
|
||||
self.create_prof(ApparatData.get_prof_details())
|
||||
prof_id = self.get_prof_id(ApparatData.profname)
|
||||
|
||||
query = f"INSERT OR IGNORE INTO semesterapparat (appnr, name, erstellsemester, dauer, prof_id, fach,deletion_status,konto) VALUES ('{ApparatData.appnr}', '{ApparatData.appname}', '{ApparatData.semester}', '{ApparatData.dauerapp}', {prof_id}, '{ApparatData.app_fach}', '{ApparatData.deleted}', '{SEMAP_MEDIA_ACCOUNTS[ApparatData.appnr]}')"
|
||||
print(query)
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
logger.log_info(f"Created new apparat {ApparatData.appname}")
|
||||
app_id = self.get_app_id(ApparatData.appname)
|
||||
# if ApparatData.media_list is not None: #! Deprecated
|
||||
# for media in ApparatData.media_list:
|
||||
# self.insert_file(media, app_id)
|
||||
# self.database.commit()
|
||||
return app_id
|
||||
|
||||
def create_prof(self, prof_details: dict):
|
||||
prof_title = prof_details["prof_title"]
|
||||
prof_fname = prof_details["profname"].split(",")[1]
|
||||
prof_fname = prof_fname.strip()
|
||||
prof_lname = prof_details["profname"].split(",")[0]
|
||||
prof_lname = prof_lname.strip()
|
||||
prof_fullname = prof_details["profname"].replace(",", "")
|
||||
prof_mail = prof_details["prof_mail"]
|
||||
prof_tel = prof_details["prof_tel"]
|
||||
|
||||
query = f'INSERT OR IGNORE INTO prof (titel, fname, lname, fullname, mail, telnr) VALUES ("{prof_title}", "{prof_fname}", "{prof_lname}", "{prof_fullname}", "{prof_mail}", "{prof_tel}")'
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
pass
|
||||
|
||||
def get_apparat_nrs(self) -> list:
|
||||
try:
|
||||
self.cur.execute(
|
||||
"SELECT appnr FROM semesterapparat Where deletion_status=0"
|
||||
)
|
||||
except sql3.OperationalError:
|
||||
return []
|
||||
return [i[0] for i in self.cur.fetchall()]
|
||||
|
||||
def get_all_apparts(self, deleted=0):
|
||||
|
||||
self.cur.execute(
|
||||
f"SELECT * FROM semesterapparat WHERE deletion_status={deleted}"
|
||||
)
|
||||
return self.cur.fetchall()
|
||||
|
||||
#
|
||||
def get_app_data(self, appnr, appname) -> ApparatData:
|
||||
result = self.cur.execute(
|
||||
f"SELECT * FROM semesterapparat WHERE appnr='{appnr}' AND name='{appname}'"
|
||||
).fetchone()
|
||||
print(f"result: {result}")
|
||||
# app_id=result[0]
|
||||
data = ApparatData()
|
||||
data.appnr = appnr
|
||||
data.app_fach = result[3]
|
||||
data.appname = result[1]
|
||||
profname = self.get_prof_name_by_id(result[2])
|
||||
# set profname to lastname, firstname
|
||||
profname = f"{profname.split(' ')[0]}, {profname.split(' ')[1]}"
|
||||
data.profname = profname
|
||||
prof_data = self.get_prof_data(data.profname)
|
||||
data.prof_mail = prof_data["prof_mail"]
|
||||
data.prof_tel = prof_data["prof_tel"]
|
||||
data.prof_title = prof_data["prof_title"]
|
||||
data.erstellsemester = result[5]
|
||||
data.semester = result[8]
|
||||
data.deleted = result[9]
|
||||
data.apparat_adis_id = result[12]
|
||||
data.prof_adis_id = None
|
||||
|
||||
print(data)
|
||||
# data.media_list=self.get_media(app_id)
|
||||
|
||||
return data
|
||||
|
||||
def add_medium(self, bookdata: BookData, app_id: str, prof_id: str, *args):
|
||||
# insert the bookdata into the media table
|
||||
# try to retrieve the bookdata from the media table, check if the to be inserted bookdata is already in the table for the corresponding apparat
|
||||
# if yes, do not insert the bookdata
|
||||
# if no, insert the bookdata
|
||||
t_query = (
|
||||
f"SELECT bookdata FROM media WHERE app_id={app_id} AND prof_id={prof_id}"
|
||||
)
|
||||
# print(t_query)
|
||||
result = self.cur.execute(t_query).fetchall()
|
||||
result = [pickle.loads(i[0]) for i in result]
|
||||
if bookdata in result:
|
||||
print("Bookdata already in database")
|
||||
# check if the book was deleted in the apparat
|
||||
query = (
|
||||
"SELECT deleted FROM media WHERE app_id=? AND prof_id=? AND bookdata=?"
|
||||
)
|
||||
params = (app_id, prof_id, pickle.dumps(bookdata))
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
if result[0] == 1:
|
||||
print("Book was deleted, updating bookdata")
|
||||
query = "UPDATE media SET deleted=0 WHERE app_id=? AND prof_id=? AND bookdata=?"
|
||||
params = (app_id, prof_id, pickle.dumps(bookdata))
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
return
|
||||
|
||||
query = (
|
||||
"INSERT INTO media (bookdata, app_id, prof_id,deleted) VALUES (?, ?, ?,?)"
|
||||
)
|
||||
converted = pickle.dumps(bookdata)
|
||||
params = (converted, app_id, prof_id, 0)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def request_medium(self, app_id, prof_id, signature) -> int:
|
||||
query = "SELECT bookdata, id FROM media WHERE app_id=? AND prof_id=?"
|
||||
params = (app_id, prof_id)
|
||||
result = self.cur.execute(query, params).fetchall()
|
||||
books = [(i[1], pickle.loads(i[0])) for i in result]
|
||||
print(books)
|
||||
book = [i[0] for i in books if i[1].signature == signature]
|
||||
return book[0]
|
||||
|
||||
def add_message(self, message: dict, user, appnr):
|
||||
def __get_user_id(user):
|
||||
query = "SELECT id FROM user WHERE username=?"
|
||||
params = (user,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
return result[0]
|
||||
|
||||
user_id = __get_user_id(user)
|
||||
query = "INSERT INTO messages (message, user_id, remind_at) VALUES (?, ?, ?)"
|
||||
params = (message["message"], user_id, message["remind_at"])
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_messages(self, date: str):
|
||||
def __get_user_name(id):
|
||||
query = "SELECT username FROM user WHERE id=?"
|
||||
params = (id,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
return result[0]
|
||||
|
||||
query = f"SELECT * FROM messages WHERE remind_at='{date}'"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
ret = [
|
||||
{
|
||||
"message": i[2],
|
||||
"user": __get_user_name(i[4]),
|
||||
"apparatnr": i[5],
|
||||
"id": i[0],
|
||||
}
|
||||
for i in result
|
||||
]
|
||||
return ret
|
||||
|
||||
def get_apparat_id(self, appname):
|
||||
query = f"SELECT appnr FROM semesterapparat WHERE name='{appname}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def get_apparats_by_semester(self, semester: str):
|
||||
query = f"SELECT * FROM semesterapparat WHERE erstellsemester='{semester}'"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
return result
|
||||
|
||||
def get_semester(self) -> list[str]:
|
||||
query = "SELECT DISTINCT erstellsemester FROM semesterapparat"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
return [i for i in result]
|
||||
|
||||
def is_eternal(self, id):
|
||||
query = f"SELECT dauer FROM semesterapparat WHERE id={id}"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def statistic_request(self, **kwargs: Any):
|
||||
def __query(query):
|
||||
result = self.cur.execute(query).fetchall()
|
||||
for result_a in result:
|
||||
orig_value = result_a
|
||||
prof_name = self.get_prof_name_by_id(result_a[2])
|
||||
# replace the prof_id with the prof_name
|
||||
result_a = list(result_a)
|
||||
result_a[2] = prof_name
|
||||
result_a = tuple(result_a)
|
||||
result[result.index(orig_value)] = result_a
|
||||
|
||||
return result
|
||||
|
||||
if "deletable" in kwargs.keys():
|
||||
query = f"SELECT * FROM semesterapparat WHERE deletion_status=0 AND dauer=0 AND (erstellsemester!='{kwargs['deletesemester']}' OR verlängerung_bis!='{kwargs['deletesemester']}')"
|
||||
return __query(query)
|
||||
|
||||
if "dauer" in kwargs.keys():
|
||||
kwargs["dauer"] = kwargs["dauer"].replace("Ja", "1").replace("Nein", "0")
|
||||
query = "SELECT * FROM semesterapparat WHERE "
|
||||
for key, value in kwargs.items() if kwargs.items() is not None else {}:
|
||||
print(key, value)
|
||||
query += f"{key}='{value}' AND "
|
||||
print(query)
|
||||
# remove deletesemester part from normal query, as this will be added to the database upon deleting the apparat
|
||||
if "deletesemester" in kwargs.keys():
|
||||
query = query.replace(
|
||||
f"deletesemester='{kwargs['deletesemester']}' AND ", ""
|
||||
)
|
||||
if "endsemester" in kwargs.keys():
|
||||
if "erstellsemester" in kwargs.keys():
|
||||
query = query.replace(f"endsemester='{kwargs['endsemester']}' AND ", "")
|
||||
query = query.replace(
|
||||
f"erstellsemester='{kwargs['erstellsemester']} AND ", "xyz"
|
||||
)
|
||||
else:
|
||||
query = query.replace(
|
||||
f"endsemester='{kwargs['endsemester']}' AND ", "xyz"
|
||||
)
|
||||
print("replaced")
|
||||
query = query.replace(
|
||||
"xyz",
|
||||
f"(erstellsemester='{kwargs['endsemester']}' OR verlängerung_bis='{kwargs['endsemester']}') AND ",
|
||||
)
|
||||
# remove all x="" parts from the query where x is a key in kwargs
|
||||
|
||||
query = query[:-5]
|
||||
print(query)
|
||||
return __query(query)
|
||||
|
||||
def get_app_count_by_semester(self) -> tuple[list[str], list[int]]:
|
||||
"""get the apparats created and deleted in the distinct semesters"""
|
||||
|
||||
# get unique semesters
|
||||
query = "SELECT DISTINCT erstellsemester FROM semesterapparat"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
semesters = [i[0] for i in result]
|
||||
created = []
|
||||
deleted = []
|
||||
for semester in semesters:
|
||||
query = f"SELECT COUNT(*) FROM semesterapparat WHERE erstellsemester='{semester}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
created.append(result[0])
|
||||
query = f"SELECT COUNT(*) FROM semesterapparat WHERE deletion_status=1 AND deleted_date='{semester}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
deleted.append(result[0])
|
||||
# store data in a tuple
|
||||
ret = []
|
||||
e_tuple = ()
|
||||
for sem in semesters:
|
||||
e_tuple = (
|
||||
sem,
|
||||
created[semesters.index(sem)],
|
||||
deleted[semesters.index(sem)],
|
||||
)
|
||||
ret.append(e_tuple)
|
||||
return ret
|
||||
# get the count of apparats created in the semesters
|
||||
|
||||
def apparats_by_semester(self, semester: str):
|
||||
"""Get a list of all created and deleted apparats in the given semester"""
|
||||
# get a list of apparats created and in the given semester
|
||||
query = f"SELECT name,prof_id FROM semesterapparat WHERE erstellsemester='{semester}'"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
c_tmp = []
|
||||
for i in result:
|
||||
c_tmp.append((i[0], self.get_prof_name_by_id(i[1])))
|
||||
query = (
|
||||
f"SELECT name,prof_id FROM semesterapparat WHERE deleted_date='{semester}'"
|
||||
)
|
||||
result = self.cur.execute(query).fetchall()
|
||||
d_tmp = []
|
||||
for i in result:
|
||||
d_tmp.append((i[0], self.get_prof_name_by_id(i[1])))
|
||||
# group the apparats by prof
|
||||
c_ret = {}
|
||||
for i in c_tmp:
|
||||
if i[1] not in c_ret.keys():
|
||||
c_ret[i[1]] = [i[0]]
|
||||
else:
|
||||
c_ret[i[1]].append(i[0])
|
||||
d_ret = {}
|
||||
for i in d_tmp:
|
||||
if i[1] not in d_ret.keys():
|
||||
d_ret[i[1]] = [i[0]]
|
||||
else:
|
||||
d_ret[i[1]].append(i[0])
|
||||
return {"created": c_ret, "deleted": d_ret}
|
||||
|
||||
def delete_message(self, message_id):
|
||||
query = "DELETE FROM messages WHERE id=?"
|
||||
params = (message_id,)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def delete_medium(self, title_id):
|
||||
# delete the bookdata from the media table
|
||||
query = "UPDATE media SET deleted=1 WHERE id=?"
|
||||
params = (title_id,)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
pass
|
||||
|
||||
def update_bookdata(self, bookdata: BookData, title_id):
|
||||
query = "UPDATE media SET bookdata=? WHERE id=?"
|
||||
converted = pickle.dumps(bookdata)
|
||||
params = (converted, title_id)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_specific_book(self, book_id):
|
||||
query = "SELECT bookdata FROM media WHERE id=?"
|
||||
params = (book_id,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
return pickle.loads(result[0])
|
||||
|
||||
def get_media(self, app_id, prof_id, del_state=0) -> list[dict[int, BookData, int]]:
|
||||
"""request media from database and return result as list.
|
||||
|
||||
Args:
|
||||
----
|
||||
- app_id (int): ID of the apparat
|
||||
- prof_id (int): ID of the prof
|
||||
- del_state (int, optional): If deleted books should be requested as well. 1 = yes 0 = no. Defaults to 0.
|
||||
|
||||
Returns:
|
||||
-------
|
||||
- list[dict[int,BookData,int]]: Returns a list of dictionaries containing the bookdata, the id and the availability of the book in the following format:
|
||||
-------
|
||||
{"id": int,
|
||||
"bookdata": BookData,
|
||||
"available": int}
|
||||
"""
|
||||
query = f"SELECT id,bookdata,available FROM media WHERE (app_id={app_id} AND prof_id={prof_id}) AND (deleted={del_state if del_state == 0 else '1 OR deleted=0'})"
|
||||
logger.log_info(f"Requesting media from database with query: {query}")
|
||||
result = self.cur.execute(query).fetchall()
|
||||
ret_result = []
|
||||
for result_a in result:
|
||||
# ic(result_a)
|
||||
data = {"id": int, "bookdata": BookData, "available": int}
|
||||
data["id"] = result_a[0]
|
||||
data["bookdata"] = pickle.loads(result_a[1])
|
||||
data["available"] = result_a[2]
|
||||
ret_result.append(data)
|
||||
return ret_result
|
||||
|
||||
def get_subjects_and_aliases(self):
|
||||
query = "SELECT subjects.name, aliases.name FROM subjects LEFT JOIN aliases ON subjects.id = aliases.subject_id"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def get_subjects(self):
|
||||
query = "SELECT id,name FROM subjects"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def get_aliases(self, subject_id):
|
||||
query = f"SELECT name FROM aliases WHERE subject_id={subject_id}"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def add_subject(self, subject_name):
|
||||
query = f"INSERT INTO subjects (name) VALUES ('{subject_name}')"
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
|
||||
def get_apparats_by_prof(self, prof_id):
|
||||
query = f"SELECT * FROM semesterapparat WHERE prof_id={prof_id}"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def add_alias(self, alias_name, subject):
|
||||
query = f"SELECT id FROM subjects WHERE name='{subject}'"
|
||||
subject_id = self.cur.execute(query).fetchone()[0]
|
||||
query = f"INSERT INTO aliases (name,subject_id) VALUES ('{alias_name}',{subject_id})"
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
|
||||
def update_apparat(self, apparat_data: ApparatData):
|
||||
data = apparat_data
|
||||
query = "UPDATE semesterapparat SET name = ?, fach = ?, dauer = ?, prof_id = ? WHERE appnr = ?"
|
||||
params = (
|
||||
data.appname,
|
||||
data.app_fach,
|
||||
data.dauerapp,
|
||||
self.get_prof_id(data.profname),
|
||||
data.appnr,
|
||||
)
|
||||
print(query)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def delete_apparat(self, appnr: str, semester: str):
|
||||
# update the deletion status to 1 and the deleted_state to semester for the given apparat
|
||||
query = f"UPDATE semesterapparat SET deletion_status=1, deleted_date='{semester}' WHERE appnr='{appnr}'"
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
|
||||
def get_book_id(self, bookdata: BookData, app_id: int, prof_id: int):
|
||||
query = "SELECT id FROM media WHERE bookdata=? AND app_id=? AND prof_id=?"
|
||||
params = (pickle.loads(bookdata), app_id, prof_id)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
return result
|
||||
|
||||
def set_availability(self, book_id, available):
|
||||
query = "UPDATE media SET available=? WHERE id=?"
|
||||
params = (available, book_id)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_latest_book_id(self):
|
||||
query = "SELECT id FROM media ORDER BY id DESC LIMIT 1"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def close(self):
|
||||
self.database.close()
|
||||
|
||||
def login(self, username, hashed_password) -> bool:
|
||||
# check if the user and password exist in the database
|
||||
# if yes, return True
|
||||
# if no, return False
|
||||
query = "SELECT salt FROM user WHERE username=?"
|
||||
params = (username,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
|
||||
if result is None:
|
||||
return False
|
||||
salt = result[0]
|
||||
print(salt)
|
||||
query = "SELECT password FROM user WHERE username=?"
|
||||
params = (str(username),)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
password = result[0]
|
||||
if password == f"{salt}{hashed_password}":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
# admin stuff below here
|
||||
def get_users(self):
|
||||
query = "SELECT * FROM user"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def get_apparats(self) -> list[tuple]:
|
||||
query = "SELECT * FROM semesterapparat"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def change_password(self, user, password):
|
||||
saltq = "SELECT salt FROM user WHERE username=?"
|
||||
params = (user,)
|
||||
salt = self.cur.execute(saltq, params).fetchone()[0]
|
||||
password = f"{salt}{password}"
|
||||
query = "UPDATE user SET password=? WHERE username=?"
|
||||
params = (password, user)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_role(self, username):
|
||||
query = "SELECT role FROM user WHERE username=?"
|
||||
params = (username,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
return result[0]
|
||||
|
||||
def get_roles(self):
|
||||
query = "SELECT role FROM user"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def create_user(self, username, password, role, salt):
|
||||
"""Create a user based on passed data.
|
||||
|
||||
Args:
|
||||
----
|
||||
- username (str): Username to be used
|
||||
- password (str): the salted password
|
||||
- role (str): Role of the user
|
||||
- salt (str): a random salt for the user
|
||||
"""
|
||||
query = "INSERT OR IGNORE INTO user (username, password, role, salt) VALUES (?, ?, ?, ?)"
|
||||
params = (username, password, role, salt)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def delete_user(self, user):
|
||||
query = "DELETE FROM user WHERE username=?"
|
||||
params = (user,)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_faculty_members(self, name: str = None):
|
||||
query = "SELECT titel, fname,lname,mail,telnr,fullname FROM prof"
|
||||
if name:
|
||||
query = query.replace(",fullname", "")
|
||||
query += f" WHERE fullname='{name}'"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def update_faculty_member(self, data, oldlname, oldfname):
|
||||
placeholders = ", ".join(f"{k} = :{k}" for k in data.keys())
|
||||
sql = f"UPDATE prof SET {placeholders} WHERE lname = :oldlname AND fname = :oldfname"
|
||||
data["oldlname"] = oldlname
|
||||
data["oldfname"] = oldfname
|
||||
print(sql, data)
|
||||
self.cur.execute(sql, data)
|
||||
self.database.commit()
|
||||
|
||||
def faculty_data(self, name):
|
||||
query = f"SELECT * FROM prof WHERE fullname='{name}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result
|
||||
|
||||
def update_user(self, username, data: dict[str, str]):
|
||||
|
||||
query = "UPDATE user SET "
|
||||
for key, value in data.items():
|
||||
if key == "username":
|
||||
continue
|
||||
query += f"{key}='{value}',"
|
||||
query = query[:-1]
|
||||
query += " WHERE username=?"
|
||||
params = (username,)
|
||||
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def check_username(self, username):
|
||||
query = "SELECT username FROM user WHERE username=?"
|
||||
params = (username,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
if result is None:
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_apparats_name(self, app_id, prof_id):
|
||||
query = f"SELECT name FROM semesterapparat WHERE appnr={app_id} AND prof_id={prof_id}"
|
||||
# ic(query)
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def search_book(self, data: dict[str, str]) -> list[tuple[BookData, int]]:
|
||||
query = "SELECT * FROM media "
|
||||
result = self.database.execute(query).fetchall()
|
||||
ret = []
|
||||
# get length of data dict
|
||||
length = len(data)
|
||||
mode = 0
|
||||
if length == 1:
|
||||
if "signature" in data.keys():
|
||||
mode = 1
|
||||
elif "title" in data.keys():
|
||||
mode = 2
|
||||
elif length == 2:
|
||||
mode = 3
|
||||
else:
|
||||
return None
|
||||
print(len(result))
|
||||
for res in result:
|
||||
bookdata = pickle.loads(res[1])
|
||||
app_id = res[2]
|
||||
prof_id = res[3]
|
||||
# if signature and title present in dict:
|
||||
# if signature present in dict:
|
||||
if mode == 1:
|
||||
if data["signature"] in bookdata.signature:
|
||||
ret.append((bookdata, app_id, prof_id))
|
||||
# if title present in dict:
|
||||
elif mode == 2:
|
||||
if data["title"] in bookdata.title:
|
||||
ret.append((bookdata, app_id, prof_id))
|
||||
elif mode == 3:
|
||||
if (
|
||||
data["signature"] in bookdata.signature
|
||||
and data["title"] in bookdata.title
|
||||
):
|
||||
ret.append((bookdata, app_id, prof_id))
|
||||
return ret
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
db = Database()
|
||||
print(db.login("kirchner", "loginpass"))
|
||||
@@ -1,9 +1,10 @@
|
||||
import pickle
|
||||
from typing import ByteString, Any
|
||||
from typing import Any, ByteString
|
||||
|
||||
def make_pickle(data:Any):
|
||||
|
||||
def make_pickle(data: Any):
|
||||
return pickle.dumps(data)
|
||||
|
||||
|
||||
def load_pickle(data:ByteString):
|
||||
def load_pickle(data: ByteString):
|
||||
return pickle.loads(data)
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import datetime
|
||||
|
||||
|
||||
def generateSemesterByDate():
|
||||
currentYear = datetime.datetime.now().year
|
||||
currentYear = int(str(currentYear)[-2:])
|
||||
month = datetime.datetime.now().month
|
||||
if month >= 4 and month <= 9:
|
||||
return "SoSe " + str(currentYear)
|
||||
currentYear = datetime.datetime.now().year
|
||||
currentYear = int(str(currentYear)[-2:])
|
||||
month = datetime.datetime.now().month
|
||||
if month >= 4 and month <= 9:
|
||||
return "SoSe " + str(currentYear)
|
||||
else:
|
||||
if month == 10 or month == 11:
|
||||
return f"WiSe {currentYear}/{currentYear+1}"
|
||||
else:
|
||||
if month == 10 or month == 11:
|
||||
return f"WiSe {currentYear}/{currentYear+1}"
|
||||
else:
|
||||
return f"WiSe {currentYear-1}/{currentYear}"
|
||||
return f"WiSe {currentYear-1}/{currentYear}"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
class NoResultError(Exception):
|
||||
def __init__(self,message):
|
||||
self.message = f"The query: {message} returned no results"
|
||||
def __init__(self, message):
|
||||
self.message = f"The query: {message} returned no results"
|
||||
super().__init__(self.message)
|
||||
|
||||
|
||||
|
||||
class AppPresentError(Exception):
|
||||
def __init__(self, message):
|
||||
self.message = f"The app {message} is already present in the database"
|
||||
super().__init__(self.message)
|
||||
super().__init__(self.message)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#import basic error classes
|
||||
from .DatabaseErrors import *
|
||||
# import basic error classes
|
||||
from .DatabaseErrors import *
|
||||
|
||||
@@ -212,4 +212,4 @@ SEMAP_MEDIA_ACCOUNTS = {
|
||||
"178": "1008017766",
|
||||
"179": "1008017899",
|
||||
"180": "1008017922",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,15 +7,16 @@ def csv_to_list(path: str) -> list[str]:
|
||||
"""
|
||||
Extracts the data from a csv file and returns it as a pandas dataframe
|
||||
"""
|
||||
with open(path, newline='') as csvfile:
|
||||
reader = csv.reader(csvfile, delimiter=';', quotechar='|')
|
||||
with open(path, newline="") as csvfile:
|
||||
reader = csv.reader(csvfile, delimiter=";", quotechar="|")
|
||||
ret = []
|
||||
for row in reader:
|
||||
print(row)
|
||||
ret.append(row[0].replace('"', ""))
|
||||
return ret
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
text = csv_to_list("C:/Users/aky547/Desktop/semap/71.csv")
|
||||
#remove linebreaks
|
||||
print(text)
|
||||
# remove linebreaks
|
||||
print(text)
|
||||
|
||||
@@ -2,6 +2,7 @@ import re
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
|
||||
|
||||
@dataclass
|
||||
class ApparatData:
|
||||
prof_title: str | None = None
|
||||
@@ -101,17 +102,17 @@ class Subjects(Enum):
|
||||
TECHNIC = (22, "Technik")
|
||||
THEOLOGY = (23, "Theologie")
|
||||
ECONOMICS = (24, "Wirtschaftslehre")
|
||||
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
return self.value[0]
|
||||
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.value[1]
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_index(cls, name):
|
||||
for i in cls:
|
||||
if i.name == name:
|
||||
return i.id -1
|
||||
return i.id - 1
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
from docx import Document
|
||||
|
||||
data={}
|
||||
wordDoc = Document('files/Semesterapparat - Anmeldung.docx')
|
||||
data = {}
|
||||
wordDoc = Document("files/Semesterapparat - Anmeldung.docx")
|
||||
paragraphs = wordDoc.tables
|
||||
for table in paragraphs:
|
||||
for column in table.columns:
|
||||
cellcount=0
|
||||
cellcount = 0
|
||||
for cell in column.cells:
|
||||
if cellcount<12:
|
||||
cellcount+=1
|
||||
print(f'cell:{cell.text}')
|
||||
|
||||
|
||||
if cellcount < 12:
|
||||
cellcount += 1
|
||||
print(f"cell:{cell.text}")
|
||||
|
||||
# print(f'paragraphs[{i}]: {paragraphs[i]}')
|
||||
# data[i] = paragraphs[i]
|
||||
|
||||
|
||||
# for i in range(0, len(paragraphs)):
|
||||
# for i in range(2, len(paragraphs)):
|
||||
# data[i] = paragraphs[i]
|
||||
|
||||
|
||||
print(data)
|
||||
|
||||
# for table in wordDoc.tables:
|
||||
@@ -26,6 +25,3 @@ print(data)
|
||||
# print('---')
|
||||
# for cell in row.cells:
|
||||
# print(f'cell:{cell.text}')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import tabula
|
||||
|
||||
file = "files/Semesterapparat - Anmeldung.pdf"
|
||||
|
||||
file="files/Semesterapparat - Anmeldung.pdf"
|
||||
|
||||
def extract_book_data(file):
|
||||
tables=tabula.read_pdf(file,pages="all",encoding="utf-8",multiple_tables=True)
|
||||
tabula.read_pdf(file, pages="all", encoding="utf-8", multiple_tables=True)
|
||||
tabula.convert_into(file, file.replace(".pdf"), output_format="csv", pages="all")
|
||||
with open("files/Semesterapparat - Anmeldung.csv", "r") as f:
|
||||
content=f.read()
|
||||
|
||||
f.read()
|
||||
|
||||
@@ -1,25 +1,38 @@
|
||||
import logging
|
||||
import logging.handlers
|
||||
import os
|
||||
|
||||
if not os.path.exists("logs"):
|
||||
os.mkdir("logs")
|
||||
#open and close the file to create it
|
||||
# open and close the file to create it
|
||||
with open("logs/application.log", "w") as f:
|
||||
pass
|
||||
|
||||
log_filesize = 10 * 1024**2 # 10MB
|
||||
backups = 5
|
||||
# Create a common file handler for all loggers
|
||||
common_file_handler = logging.FileHandler("logs/application.log")
|
||||
common_file_handler = logging.handlers.RotatingFileHandler(
|
||||
"logs/application.log",
|
||||
mode="a",
|
||||
encoding="utf-8",
|
||||
maxBytes=log_filesize,
|
||||
backupCount=backups,
|
||||
)
|
||||
|
||||
common_file_handler.setLevel(logging.DEBUG)
|
||||
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
common_file_handler.setFormatter(formatter)
|
||||
#set max file size to 10MB, if exceeded, create a new file
|
||||
|
||||
|
||||
# set max file size to 10MB, if exceeded, create a new file
|
||||
|
||||
|
||||
class MyLogger:
|
||||
def __init__(self, logger_name):
|
||||
self.logger = logging.getLogger(logger_name)
|
||||
self.logger.setLevel(logging.DEBUG)
|
||||
self.logger.addHandler(common_file_handler)
|
||||
self.encoding = "utf-8"
|
||||
|
||||
|
||||
def log_info(self, message: str):
|
||||
# ensure that the message is encoded in utf-8
|
||||
@@ -61,6 +74,6 @@ if __name__ == "__main__":
|
||||
try:
|
||||
# Simulate an exception
|
||||
raise Exception("An exception occurred")
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
logger1.log_exception("An exception occurred in Logger1")
|
||||
logger2.log_exception("An exception occurred in Logger2")
|
||||
|
||||
@@ -12,19 +12,15 @@ def pdf_to_csv(path: str) -> pd.DataFrame:
|
||||
"""
|
||||
file = PDFQuery(path)
|
||||
file.load()
|
||||
#get the text from the pdf file
|
||||
text_elems = file.extract([
|
||||
('with_formatter', 'text'),
|
||||
('all_text', '*')
|
||||
])
|
||||
extracted_text = text_elems['all_text']
|
||||
|
||||
# get the text from the pdf file
|
||||
text_elems = file.extract([("with_formatter", "text"), ("all_text", "*")])
|
||||
extracted_text = text_elems["all_text"]
|
||||
|
||||
return extracted_text
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
text = pdf_to_csv("54_pdf.pdf")
|
||||
#remove linebreaks
|
||||
# remove linebreaks
|
||||
text = text.replace("\n", "")
|
||||
print(text)
|
||||
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
import yaml
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
@dataclass
|
||||
class Settings:
|
||||
"""Settings for the app."""
|
||||
|
||||
save_path: str
|
||||
database_name: str
|
||||
database_path: str
|
||||
default_apps:bool = True
|
||||
default_apps: bool = True
|
||||
custom_applications: list[dict] = field(default_factory=list)
|
||||
|
||||
def save_settings(self):
|
||||
"""Save the settings to the config file."""
|
||||
with open("config.yaml", "w") as f:
|
||||
yaml.dump(self.__dict__, f)
|
||||
|
||||
#open the config file and load the settings
|
||||
|
||||
|
||||
# open the config file and load the settings
|
||||
with open("config.yaml", "r") as f:
|
||||
data = yaml.safe_load(f)
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sqlite3
|
||||
import time
|
||||
|
||||
from PyQt6.QtCore import QThread, pyqtSignal as Signal
|
||||
from PyQt6.QtCore import QThread
|
||||
from PyQt6.QtCore import pyqtSignal as Signal
|
||||
|
||||
from src.backend.database import Database
|
||||
from src.logic.log import MyLogger
|
||||
@@ -62,8 +63,8 @@ class BookGrabber(QThread):
|
||||
for rds_item in rds.items:
|
||||
sign = rds_item.superlocation
|
||||
loc = rds_item.location
|
||||
#ic(sign, loc)
|
||||
#ic(rds_item)
|
||||
# ic(sign, loc)
|
||||
# ic(rds_item)
|
||||
if self.app_id in sign or self.app_id in loc:
|
||||
state = 1
|
||||
break
|
||||
|
||||
@@ -2,10 +2,11 @@ import os
|
||||
import sqlite3
|
||||
import time
|
||||
|
||||
#from icecream import ic
|
||||
# from icecream import ic
|
||||
from omegaconf import OmegaConf
|
||||
from PyQt6 import QtWidgets
|
||||
from PyQt6.QtCore import QThread, pyqtSignal as Signal
|
||||
from PyQt6.QtCore import QThread
|
||||
from PyQt6.QtCore import pyqtSignal as Signal
|
||||
|
||||
from src.backend.database import Database
|
||||
from src.logic.log import MyLogger
|
||||
@@ -26,7 +27,7 @@ class BackgroundChecker(QThread):
|
||||
class MockAvailCheck:
|
||||
|
||||
def __init__(
|
||||
self, links: list = [], appnumber: int = None, parent=None, books=list[dict]
|
||||
self, links: list = None, appnumber: int = None, parent=None, books=list[dict]
|
||||
):
|
||||
if links is None:
|
||||
links = []
|
||||
@@ -58,7 +59,7 @@ class MockAvailCheck:
|
||||
for item in rds.items:
|
||||
sign = item.superlocation
|
||||
loc = item.location
|
||||
#ic(item.location, item.superlocation)
|
||||
# ic(item.location, item.superlocation)
|
||||
if self.appnumber in sign or self.appnumber in loc:
|
||||
state = 1
|
||||
book_id = None
|
||||
@@ -197,18 +198,3 @@ class MailThread(QThread):
|
||||
def run(self):
|
||||
self.show_ui()
|
||||
self.updateSignal.emit(1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import time
|
||||
|
||||
#from icecream import ic
|
||||
from PyQt6.QtCore import QThread, pyqtSignal as Signal
|
||||
# from icecream import ic
|
||||
from PyQt6.QtCore import QThread
|
||||
from PyQt6.QtCore import pyqtSignal as Signal
|
||||
|
||||
from src.backend.database import Database
|
||||
from src.logic.log import MyLogger
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import time
|
||||
|
||||
#from icecream import ic
|
||||
from PyQt6.QtCore import QThread, pyqtSignal as Signal
|
||||
# from icecream import ic
|
||||
from PyQt6.QtCore import QThread
|
||||
from PyQt6.QtCore import pyqtSignal as Signal
|
||||
|
||||
from src.backend.database import Database
|
||||
from src.logic.log import MyLogger
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import os
|
||||
import sqlite3
|
||||
import threading
|
||||
import time
|
||||
import os
|
||||
|
||||
from PyQt6.QtCore import QThread, pyqtSignal
|
||||
|
||||
from src.backend.database import Database
|
||||
from src.logic.log import MyLogger
|
||||
from src.transformers import RDS_AVAIL_DATA
|
||||
from src.logic.webrequest import BibTextTransformer, WebRequest
|
||||
import sqlite3
|
||||
#from icecream import ic
|
||||
from src.transformers import RDS_AVAIL_DATA
|
||||
|
||||
# from icecream import ic
|
||||
|
||||
|
||||
class BookGrabber(QThread):
|
||||
@@ -19,8 +21,8 @@ class BookGrabber(QThread):
|
||||
self.is_Running = True
|
||||
self.logger = MyLogger("Worker")
|
||||
self.logger.log_info("Starting worker thread")
|
||||
self.data,self.app_id,self.prof_id,self.mode = self.readFile(filename)
|
||||
|
||||
self.data, self.app_id, self.prof_id, self.mode = self.readFile(filename)
|
||||
|
||||
self.book_id = None
|
||||
time.sleep(2)
|
||||
|
||||
@@ -68,8 +70,8 @@ class BookGrabber(QThread):
|
||||
for rds_item in rds.items:
|
||||
sign = rds_item.superlocation
|
||||
loc = rds_item.location
|
||||
#ic(sign, loc)
|
||||
#ic(rds_item)
|
||||
# ic(sign, loc)
|
||||
# ic(rds_item)
|
||||
if self.app_id in sign or self.app_id in loc:
|
||||
state = 1
|
||||
break
|
||||
@@ -213,7 +215,7 @@ class AutoAdder(QThread):
|
||||
class MockAvailCheck:
|
||||
|
||||
def __init__(
|
||||
self, links: list = [], appnumber: int = None, parent=None, books=list[dict]
|
||||
self, links: list = None, appnumber: int = None, parent=None, books=list[dict]
|
||||
):
|
||||
if links is None:
|
||||
links = []
|
||||
@@ -245,7 +247,7 @@ class MockAvailCheck:
|
||||
for item in rds.items:
|
||||
sign = item.superlocation
|
||||
loc = item.location
|
||||
#ic(item.location, item.superlocation)
|
||||
# ic(item.location, item.superlocation)
|
||||
if self.appnumber in sign or self.appnumber in loc:
|
||||
state = 1
|
||||
book_id = None
|
||||
|
||||
@@ -16,8 +16,6 @@ from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6.QtCore import QDate, QThread
|
||||
from PyQt6.QtGui import QColor, QRegularExpressionValidator
|
||||
|
||||
# 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
|
||||
@@ -29,7 +27,7 @@ from src.logic.csvparser import csv_to_list
|
||||
from src.logic.dataclass import ApparatData, BookData
|
||||
from src.logic.log import MyLogger
|
||||
from src.logic.wordparser import word_docx_to_csv
|
||||
from src.ui import ( # Mail_Dialog,
|
||||
from src.ui import (
|
||||
App_Ext_Dialog,
|
||||
FilePicker,
|
||||
GraphWidget,
|
||||
@@ -63,7 +61,6 @@ class Medien(medienadder_ui):
|
||||
return self.comboBox.currentText()
|
||||
|
||||
|
||||
|
||||
class MyComboBox(QtWidgets.QComboBox):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
@@ -184,18 +181,7 @@ class Ui(Ui_Semesterapparat):
|
||||
QtWidgets.QScrollBar(), QtCore.Qt.AlignmentFlag.AlignRight
|
||||
)
|
||||
# connect contextmenuevent to tablewidget
|
||||
self.tableWidget_apparate.setContextMenuPolicy(
|
||||
QtCore.Qt.ContextMenuPolicy.CustomContextMenu
|
||||
)
|
||||
self.tableWidget_apparate.customContextMenuRequested.connect(
|
||||
self.open_context_menu
|
||||
)
|
||||
self.tableWidget_apparat_media.setContextMenuPolicy(
|
||||
QtCore.Qt.ContextMenuPolicy.CustomContextMenu
|
||||
)
|
||||
self.tableWidget_apparat_media.customContextMenuRequested.connect(
|
||||
self.media_context_menu
|
||||
)
|
||||
|
||||
# enable automatic resizing of columns for book_search_result
|
||||
self.book_search_result.horizontalHeader().setSectionResizeMode(
|
||||
QtWidgets.QHeaderView.ResizeMode.Stretch
|
||||
@@ -235,6 +221,9 @@ class Ui(Ui_Semesterapparat):
|
||||
self.label_20.hide()
|
||||
self.line_3.hide()
|
||||
self.avail_status.hide()
|
||||
self.chkbx_show_del_media.hide()
|
||||
self.groupBox_2.hide()
|
||||
self.groupBox.hide()
|
||||
self.check_deletable.stateChanged.connect(self.gridchange)
|
||||
self.tableWidget.horizontalHeader().setSectionResizeMode(
|
||||
QtWidgets.QHeaderView.ResizeMode.Stretch
|
||||
@@ -247,6 +236,9 @@ class Ui(Ui_Semesterapparat):
|
||||
self.tableWidget.resizeColumnsToContents()
|
||||
self.tableWidget.resizeRowsToContents()
|
||||
# set self.app_fach viable inputs to be
|
||||
# self.app_fach.addItems([subject[1] for subject in self.db.getSubjects()])
|
||||
# self.app_fach.addItem("")
|
||||
# self.app_fach.setCurrentText("")
|
||||
|
||||
# create a thread, that continually checks the validity of the inputs
|
||||
|
||||
@@ -269,10 +261,6 @@ class Ui(Ui_Semesterapparat):
|
||||
# self.thread_check()
|
||||
|
||||
### Admin interface ###
|
||||
#!admin - create user
|
||||
#!admin - delete user
|
||||
#!admin - change user
|
||||
# TODO:admin - change faculty
|
||||
self.select_action_box.addItem("")
|
||||
self.select_action_box.setCurrentText("")
|
||||
self.hide_all()
|
||||
@@ -282,7 +270,22 @@ class Ui(Ui_Semesterapparat):
|
||||
)
|
||||
self.book_search.clicked.connect(self.search_book)
|
||||
|
||||
# enable click functionality for the combobox to allow selection of roles
|
||||
# Context Menus
|
||||
self.tableWidget_apparate.setContextMenuPolicy(
|
||||
QtCore.Qt.ContextMenuPolicy.CustomContextMenu
|
||||
)
|
||||
self.tableWidget_apparat_media.setContextMenuPolicy(
|
||||
QtCore.Qt.ContextMenuPolicy.CustomContextMenu
|
||||
)
|
||||
self.tableWidget_apparate.customContextMenuRequested.connect(
|
||||
self.open_context_menu
|
||||
)
|
||||
self.tableWidget_apparat_media.customContextMenuRequested.connect(
|
||||
self.media_context_menu
|
||||
)
|
||||
self.tableWidget.customContextMenuRequested.connect(
|
||||
self.statistics_table_context_menu
|
||||
)
|
||||
|
||||
# admin buttons
|
||||
self.user_frame_addUser.clicked.connect(self.add_user)
|
||||
@@ -290,6 +293,7 @@ class Ui(Ui_Semesterapparat):
|
||||
self.update_user.clicked.connect(self.update_user_data)
|
||||
self.update_faculty_member.clicked.connect(self.edit_faculty_member_action)
|
||||
|
||||
# Create instances to be used by the threads in the application
|
||||
self.bookGrabber = None
|
||||
self.availChecker = None
|
||||
self.mail_thread = None
|
||||
@@ -322,7 +326,7 @@ class Ui(Ui_Semesterapparat):
|
||||
"title": title if title != "" else None,
|
||||
}
|
||||
params = {key: value for key, value in params.items() if value is not None}
|
||||
#ic(params)
|
||||
# ic(params)
|
||||
retdata = self.db.searchBook(params)
|
||||
if retdata is None:
|
||||
return
|
||||
@@ -378,7 +382,7 @@ class Ui(Ui_Semesterapparat):
|
||||
password = self.user_create_frame_password.text()
|
||||
role = self.user_frame_userrole.currentText()
|
||||
if self.db.checkUsername(username):
|
||||
#ic("username already exists")
|
||||
# ic("username already exists")
|
||||
# self.user_create_frame_error.setText("Der Nutzername ist bereits vergeben")#TODO: implement error message
|
||||
return
|
||||
userdata = AdminCommands().create_password(password)
|
||||
@@ -402,8 +406,10 @@ class Ui(Ui_Semesterapparat):
|
||||
)
|
||||
self.user_delete_confirm.setChecked(False)
|
||||
else:
|
||||
self.user_delete_err_message.setText("Bitte bestätigen Sie die Löschung des Nutzers") # TODO: implement error message
|
||||
#ic("please confirm the deletion of the user")
|
||||
self.user_delete_err_message.setText(
|
||||
"Bitte bestätigen Sie die Löschung des Nutzers"
|
||||
) # TODO: implement error message
|
||||
# ic("please confirm the deletion of the user")
|
||||
|
||||
def update_user_data(self):
|
||||
username = self.user_edit_frame_user_select.currentText()
|
||||
@@ -752,15 +758,21 @@ class Ui(Ui_Semesterapparat):
|
||||
def delete_selected_apparats(self):
|
||||
# get all selected apparats
|
||||
selected_apparats = []
|
||||
selected_apparat_rows = []
|
||||
for i in range(self.tableWidget.rowCount()):
|
||||
if self.tableWidget.cellWidget(i, 0).isChecked():
|
||||
selected_apparats.append(self.tableWidget.item(i, 2).text())
|
||||
selected_apparat_rows.append(i)
|
||||
# delete all selected apparats
|
||||
print(selected_apparats)
|
||||
for apparat in selected_apparats:
|
||||
self.db.deleteApparat(apparat, self.generateSemester(today=True))
|
||||
for row in selected_apparat_rows:
|
||||
# set the background of the row to red
|
||||
for j in range(5):
|
||||
self.tableWidget.item(row, j).setBackground(QtGui.QColor(235, 74, 71))
|
||||
# refresh the table
|
||||
self.tab_changed()
|
||||
self.populate_tab()
|
||||
self.btn_del_select_apparats.setEnabled(False)
|
||||
|
||||
def statistics(self):
|
||||
@@ -842,7 +854,7 @@ class Ui(Ui_Semesterapparat):
|
||||
|
||||
def populate_frame(self, appdata: ApparatData):
|
||||
# populate the frame with the data from the database
|
||||
#ic(appdata)
|
||||
# ic(appdata)
|
||||
self.drpdwn_app_nr.setCurrentText(str(appdata.appnr))
|
||||
self.prof_title.setText(appdata.prof_title)
|
||||
prof_name = appdata.profname.split(" ")
|
||||
@@ -912,6 +924,8 @@ class Ui(Ui_Semesterapparat):
|
||||
|
||||
self.update_app_media_list()
|
||||
self.cancel_active_selection.click()
|
||||
self.check_send_mail.show()
|
||||
self.chkbx_show_del_media.show()
|
||||
|
||||
def confirm_popup(self, message: str):
|
||||
dial = QtWidgets.QDialog()
|
||||
@@ -1052,7 +1066,7 @@ class Ui(Ui_Semesterapparat):
|
||||
return
|
||||
selected_prof = self.drpdwn_prof_name.currentText()
|
||||
data = self.db.getProfData(selected_prof)
|
||||
#ic(data)
|
||||
# ic(data)
|
||||
prof_title = data[2]
|
||||
if prof_title == "None":
|
||||
prof_title = "Kein Titel"
|
||||
@@ -1071,12 +1085,13 @@ class Ui(Ui_Semesterapparat):
|
||||
return None
|
||||
|
||||
def load_app_data(self, app_id=None):
|
||||
print(type(app_id))
|
||||
|
||||
if isinstance(app_id, str):
|
||||
# double click the tableWidget_apparate row with the given app_id
|
||||
row, column = self.get_index_of_value(self.tableWidget_apparate, app_id)
|
||||
# set the current index to the row
|
||||
self.tableWidget_apparate.setCurrentCell(row, 0)
|
||||
self.check_send_mail.hide()
|
||||
app_pos = self.tableWidget_apparate.currentIndex()
|
||||
appnr = self.tableWidget_apparate.item(app_pos.row(), 0).text()
|
||||
appname = self.tableWidget_apparate.item(app_pos.row(), 1).text()
|
||||
@@ -1089,6 +1104,7 @@ class Ui(Ui_Semesterapparat):
|
||||
self.populate_frame(appdata)
|
||||
self.btn_apparat_save.hide()
|
||||
self.btn_reserve.show()
|
||||
self.chkbx_show_del_media.show()
|
||||
self.drpdwn_app_nr.setDisabled(True)
|
||||
self.update_app_media_list()
|
||||
self.update_documemt_list()
|
||||
@@ -1128,9 +1144,7 @@ class Ui(Ui_Semesterapparat):
|
||||
self.chkbx_show_del_media.setEnabled(True)
|
||||
self.drpdwn_app_nr.setEnabled(True)
|
||||
self.app_fach.setEnabled(True)
|
||||
self.app_fach.addItems([subject[1] for subject in self.db.getSubjects()])
|
||||
self.app_fach.addItem("")
|
||||
self.app_fach.setCurrentText("")
|
||||
|
||||
if self.tableWidget_apparat_media.rowCount() > 0:
|
||||
self.tableWidget_apparat_media.setRowCount(0)
|
||||
# clear all fields
|
||||
@@ -1281,6 +1295,9 @@ class Ui(Ui_Semesterapparat):
|
||||
self.dokument_list.setRowCount(0)
|
||||
self.frame.setEnabled(False)
|
||||
self.app_fach.setCurrentText("")
|
||||
self.chkbx_show_del_media.hide()
|
||||
self.check_send_mail.hide()
|
||||
self.btn_reserve.hide()
|
||||
for child in self.frame.findChildren(QtWidgets.QLineEdit):
|
||||
child.clear()
|
||||
|
||||
@@ -1297,7 +1314,7 @@ class Ui(Ui_Semesterapparat):
|
||||
# booklist:list[BookData]=[book[0] for book in books]
|
||||
self.tableWidget_apparat_media.setRowCount(0)
|
||||
for book in books:
|
||||
book_id = book["id"]
|
||||
book["id"]
|
||||
book_data = book["bookdata"]
|
||||
availability = book["available"]
|
||||
# bd = BookData().from_string(book)
|
||||
@@ -1587,7 +1604,7 @@ class Ui(Ui_Semesterapparat):
|
||||
]
|
||||
|
||||
signatures = [i for i in signatures if i != ""]
|
||||
#ic(signatures)
|
||||
# ic(signatures)
|
||||
print("starting thread")
|
||||
self.autoGrabber = BookGrabber(
|
||||
mode="ARRAY", app_id=app_id, prof_id=prof_id, data=signatures
|
||||
@@ -1638,6 +1655,7 @@ class Ui(Ui_Semesterapparat):
|
||||
self.drpdwn_prof_name.clear()
|
||||
self.tableWidget_apparat_media.setRowCount(0)
|
||||
self.frame.setEnabled(False)
|
||||
self.check_send_mail.setChecked(False)
|
||||
|
||||
if not self.validate_fields():
|
||||
self.confirm_popup("Bitte alle Pflichtfelder ausfüllen!")
|
||||
@@ -1718,7 +1736,7 @@ class Ui(Ui_Semesterapparat):
|
||||
self.old_apparats = self.apparats
|
||||
|
||||
def insert_apparat_into_table(self, apparat):
|
||||
#ic(apparat)
|
||||
# ic(apparat)
|
||||
|
||||
def __dauer_check(apparat):
|
||||
return "Ja" if apparat[7] == 1 else "Nein"
|
||||
@@ -1741,7 +1759,7 @@ class Ui(Ui_Semesterapparat):
|
||||
0,
|
||||
3,
|
||||
QtWidgets.QTableWidgetItem(
|
||||
str(apparat[8]) if apparat[8] != None else apparat[5]
|
||||
str(apparat[8]) if apparat[8] is not None else apparat[5]
|
||||
),
|
||||
)
|
||||
self.tableWidget_apparate.setItem(
|
||||
@@ -1766,6 +1784,23 @@ class Ui(Ui_Semesterapparat):
|
||||
remind_action.triggered.connect(self.reminder)
|
||||
menu.exec(self.tableWidget_apparate.mapToGlobal(position))
|
||||
|
||||
def statistics_table_context_menu(self, position):
|
||||
menu = QtWidgets.QMenu()
|
||||
restore_action = menu.addAction("Wiederherstellen")
|
||||
menu.addAction(restore_action)
|
||||
restore_action.triggered.connect(self.restore_apparat)
|
||||
menu.exec(self.tableWidget.mapToGlobal(position))
|
||||
|
||||
def restore_apparat(self):
|
||||
row = self.tableWidget.currentRow()
|
||||
apparat = self.tableWidget.item(row, 1).text()
|
||||
ic(apparat)
|
||||
apparat_id = self.db.getApparatId(apparat)
|
||||
# restore the apparat
|
||||
self.db.restoreApparat(apparat_id)
|
||||
# update the table
|
||||
self.reload()
|
||||
|
||||
def reminder(self):
|
||||
self.logger.log_info("Opening reminder dialog")
|
||||
dialog = QtWidgets.QDialog()
|
||||
@@ -1850,7 +1885,7 @@ class Ui(Ui_Semesterapparat):
|
||||
print(data)
|
||||
OmegaConf.save(data, "config.yaml")
|
||||
# re-load the config
|
||||
config = OmegaConf.load("config.yaml")
|
||||
OmegaConf.load("config.yaml")
|
||||
self.logger.log_info("Saved settings to config.yaml")
|
||||
self.reload()
|
||||
|
||||
@@ -2080,43 +2115,3 @@ if __name__ == "__main__":
|
||||
# app.exec()
|
||||
# open login screen
|
||||
launch_gui()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,11 +2,12 @@ import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from omegaconf import OmegaConf
|
||||
|
||||
# import sleep_and_retry decorator to retry requests
|
||||
from ratelimit import limits, sleep_and_retry
|
||||
|
||||
from src.logic.dataclass import BookData
|
||||
from src.logic.log import MyLogger
|
||||
from src.transformers import ARRAYData, BibTeXData, COinSData, RDSData, RISData
|
||||
#import sleep_and_retry decorator to retry requests
|
||||
from ratelimit import limits, sleep_and_retry
|
||||
|
||||
logger = MyLogger(__name__)
|
||||
config = OmegaConf.load("config.yaml")
|
||||
@@ -121,6 +122,7 @@ class BibTextTransformer:
|
||||
if RDS_IDENT in line:
|
||||
self.data = line
|
||||
return self
|
||||
|
||||
def return_data(self, option=None) -> BookData:
|
||||
"""Return Data to caller.
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from .transformers import (RDS_AVAIL_DATA,
|
||||
ARRAYData,
|
||||
COinSData,
|
||||
BibTeXData,
|
||||
RISData,
|
||||
RDSData)
|
||||
from .transformers import (
|
||||
RDS_AVAIL_DATA,
|
||||
ARRAYData,
|
||||
BibTeXData,
|
||||
COinSData,
|
||||
RDSData,
|
||||
RISData,
|
||||
)
|
||||
|
||||
@@ -131,7 +131,7 @@ class ARRAYData:
|
||||
.strip()
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
logger.log_exception("ARRAYData.transform failed")
|
||||
return ""
|
||||
|
||||
|
||||
@@ -14,15 +14,18 @@ class Ui_MainWindow(object):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
|
||||
MainWindow.setEnabled(True)
|
||||
MainWindow.resize(1601, 800)
|
||||
MainWindow.resize(1589, 800)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
|
||||
MainWindow.setSizePolicy(sizePolicy)
|
||||
MainWindow.setMinimumSize(QtCore.QSize(1278, 800))
|
||||
MainWindow.setMaximumSize(QtCore.QSize(1920, 800))
|
||||
MainWindow.setMaximumSize(QtCore.QSize(1590, 800))
|
||||
MainWindow.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.NoContextMenu)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap("icons/logo.ico"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
MainWindow.setWindowIcon(icon)
|
||||
MainWindow.setStatusTip("")
|
||||
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
@@ -81,7 +84,7 @@ class Ui_MainWindow(object):
|
||||
self.tableWidget_apparate = QtWidgets.QTableWidget(parent=self.horizontalLayoutWidget_2)
|
||||
self.tableWidget_apparate.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tableWidget_apparate.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents)
|
||||
self.tableWidget_apparate.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.SelectedClicked)
|
||||
self.tableWidget_apparate.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.tableWidget_apparate.setAlternatingRowColors(True)
|
||||
self.tableWidget_apparate.setTextElideMode(QtCore.Qt.TextElideMode.ElideMiddle)
|
||||
self.tableWidget_apparate.setObjectName("tableWidget_apparate")
|
||||
@@ -130,7 +133,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.app_group_box.setFont(font)
|
||||
self.app_group_box.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||
self.app_group_box.setCheckable(False)
|
||||
@@ -140,7 +142,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
font.setKerning(False)
|
||||
self.dokument_list.setFont(font)
|
||||
self.dokument_list.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
@@ -189,7 +190,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_5.setFont(font)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.sem_winter = QtWidgets.QRadioButton(parent=self.frame)
|
||||
@@ -197,7 +197,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sem_winter.setFont(font)
|
||||
self.sem_winter.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.sem_winter.setObjectName("sem_winter")
|
||||
@@ -206,7 +205,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_4.setFont(font)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.drpdwn_app_nr = QtWidgets.QComboBox(parent=self.frame)
|
||||
@@ -214,7 +212,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.drpdwn_app_nr.setFont(font)
|
||||
self.drpdwn_app_nr.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhDigitsOnly)
|
||||
self.drpdwn_app_nr.setEditable(True)
|
||||
@@ -224,7 +221,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.app_name.setFont(font)
|
||||
self.app_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.app_name.setObjectName("app_name")
|
||||
@@ -233,7 +229,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sem_sommer.setFont(font)
|
||||
self.sem_sommer.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.sem_sommer.setObjectName("sem_sommer")
|
||||
@@ -242,7 +237,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_3.setFont(font)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.label_6 = QtWidgets.QLabel(parent=self.frame)
|
||||
@@ -250,7 +244,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_6.setFont(font)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.sem_year = QtWidgets.QLineEdit(parent=self.frame)
|
||||
@@ -258,7 +251,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sem_year.setFont(font)
|
||||
self.sem_year.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.sem_year.setMaxLength(4)
|
||||
@@ -268,7 +260,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_2.setFont(font)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.btn_apparat_save = QtWidgets.QPushButton(parent=self.frame)
|
||||
@@ -276,7 +267,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_apparat_save.setFont(font)
|
||||
self.btn_apparat_save.setObjectName("btn_apparat_save")
|
||||
self.btn_apparat_apply = QtWidgets.QPushButton(parent=self.frame)
|
||||
@@ -284,7 +274,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_apparat_apply.setFont(font)
|
||||
self.btn_apparat_apply.setObjectName("btn_apparat_apply")
|
||||
self.check_eternal_app = QtWidgets.QCheckBox(parent=self.frame)
|
||||
@@ -292,7 +281,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.check_eternal_app.setFont(font)
|
||||
self.check_eternal_app.setObjectName("check_eternal_app")
|
||||
self.label_8 = QtWidgets.QLabel(parent=self.frame)
|
||||
@@ -300,7 +288,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_8.setFont(font)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.prof_mail = QtWidgets.QLineEdit(parent=self.frame)
|
||||
@@ -308,7 +295,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.prof_mail.setFont(font)
|
||||
self.prof_mail.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly)
|
||||
self.prof_mail.setMaxLength(200)
|
||||
@@ -319,7 +305,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_9.setFont(font)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.prof_tel_nr = QtWidgets.QLineEdit(parent=self.frame)
|
||||
@@ -327,7 +312,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.prof_tel_nr.setFont(font)
|
||||
self.prof_tel_nr.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhDigitsOnly)
|
||||
self.prof_tel_nr.setPlaceholderText("")
|
||||
@@ -337,7 +321,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_10.setFont(font)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.drpdwn_prof_name = QtWidgets.QComboBox(parent=self.frame)
|
||||
@@ -345,7 +328,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.drpdwn_prof_name.setFont(font)
|
||||
self.drpdwn_prof_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.drpdwn_prof_name.setEditable(True)
|
||||
@@ -358,7 +340,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.mail_mand.setFont(font)
|
||||
self.mail_mand.setObjectName("mail_mand")
|
||||
self.telnr_mand = QtWidgets.QLabel(parent=self.frame)
|
||||
@@ -366,7 +347,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.telnr_mand.setFont(font)
|
||||
self.telnr_mand.setObjectName("telnr_mand")
|
||||
self.profname_mand = QtWidgets.QLabel(parent=self.frame)
|
||||
@@ -374,7 +354,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.profname_mand.setFont(font)
|
||||
self.profname_mand.setObjectName("profname_mand")
|
||||
self.appname_mand = QtWidgets.QLabel(parent=self.frame)
|
||||
@@ -382,7 +361,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.appname_mand.setFont(font)
|
||||
self.appname_mand.setObjectName("appname_mand")
|
||||
self.fach_mand = QtWidgets.QLabel(parent=self.frame)
|
||||
@@ -390,7 +368,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.fach_mand.setFont(font)
|
||||
self.fach_mand.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.fach_mand.setObjectName("fach_mand")
|
||||
@@ -399,7 +376,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self._mand.setFont(font)
|
||||
self._mand.setObjectName("_mand")
|
||||
self.btn_add_document = QtWidgets.QPushButton(parent=self.frame)
|
||||
@@ -407,7 +383,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_add_document.setFont(font)
|
||||
self.btn_add_document.setObjectName("btn_add_document")
|
||||
self.btn_open_document = QtWidgets.QPushButton(parent=self.frame)
|
||||
@@ -415,7 +390,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_open_document.setFont(font)
|
||||
self.btn_open_document.setObjectName("btn_open_document")
|
||||
self.check_file = QtWidgets.QPushButton(parent=self.frame)
|
||||
@@ -423,7 +397,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.check_file.setFont(font)
|
||||
self.check_file.setObjectName("check_file")
|
||||
self.formLayoutWidget_2 = QtWidgets.QWidget(parent=self.frame)
|
||||
@@ -436,7 +409,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_12.setFont(font)
|
||||
self.label_12.setObjectName("label_12")
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_12)
|
||||
@@ -444,19 +416,24 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.prof_id_adis.setFont(font)
|
||||
self.prof_id_adis.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhPreferNumbers)
|
||||
self.prof_id_adis.setText("")
|
||||
self.prof_id_adis.setObjectName("prof_id_adis")
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.prof_id_adis)
|
||||
self.label_13 = QtWidgets.QLabel(parent=self.formLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_13.setFont(font)
|
||||
self.label_13.setObjectName("label_13")
|
||||
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_13)
|
||||
self.apparat_id_adis = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
self.apparat_id_adis.setFont(font)
|
||||
self.apparat_id_adis.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhPreferNumbers)
|
||||
self.apparat_id_adis.setObjectName("apparat_id_adis")
|
||||
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.apparat_id_adis)
|
||||
self.check_send_mail = QtWidgets.QCheckBox(parent=self.frame)
|
||||
@@ -464,7 +441,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.check_send_mail.setFont(font)
|
||||
self.check_send_mail.setObjectName("check_send_mail")
|
||||
self.frame_3 = QtWidgets.QFrame(parent=self.frame)
|
||||
@@ -483,7 +459,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.app_fach.setFont(font)
|
||||
self.app_fach.setObjectName("app_fach")
|
||||
self.gridLayout_6.addWidget(self.app_fach, 0, 0, 1, 1)
|
||||
@@ -494,7 +469,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.prof_title.setFont(font)
|
||||
self.prof_title.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.prof_title.setObjectName("prof_title")
|
||||
@@ -569,7 +543,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.label, 2, 0, 1, 1)
|
||||
@@ -797,6 +770,7 @@ class Ui_MainWindow(object):
|
||||
self.tableWidget = QtWidgets.QTableWidget(parent=self.table)
|
||||
self.tableWidget.setGeometry(QtCore.QRect(0, 0, 761, 391))
|
||||
self.tableWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tableWidget.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setColumnCount(5)
|
||||
@@ -1071,7 +1045,6 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.appdata_check.setFont(font)
|
||||
self.appdata_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.appdata_check.setObjectName("appdata_check")
|
||||
@@ -1080,16 +1053,14 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.media_check.setFont(font)
|
||||
self.media_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.media_check.setObjectName("media_check")
|
||||
self.ids_check = QtWidgets.QCheckBox(parent=self.groupBox_2)
|
||||
self.ids_check.setGeometry(QtCore.QRect(20, 140, 241, 41))
|
||||
self.ids_check.setGeometry(QtCore.QRect(20, 110, 241, 41))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.ids_check.setFont(font)
|
||||
self.ids_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.ids_check.setObjectName("ids_check")
|
||||
@@ -1108,7 +1079,6 @@ class Ui_MainWindow(object):
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setUnderline(False)
|
||||
font.setWeight(50)
|
||||
font.setKerning(True)
|
||||
font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault)
|
||||
self.media_checked.setFont(font)
|
||||
@@ -1121,7 +1091,6 @@ class Ui_MainWindow(object):
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setUnderline(False)
|
||||
font.setWeight(50)
|
||||
font.setKerning(True)
|
||||
font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault)
|
||||
self.media_edited_check.setFont(font)
|
||||
@@ -1134,7 +1103,6 @@ class Ui_MainWindow(object):
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setUnderline(False)
|
||||
font.setWeight(50)
|
||||
font.setKerning(True)
|
||||
font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault)
|
||||
self.app_created.setFont(font)
|
||||
@@ -1147,7 +1115,6 @@ class Ui_MainWindow(object):
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setUnderline(False)
|
||||
font.setWeight(50)
|
||||
font.setKerning(True)
|
||||
font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault)
|
||||
self.btn_copy_adis_command.setFont(font)
|
||||
@@ -1155,9 +1122,9 @@ class Ui_MainWindow(object):
|
||||
self.btn_copy_adis_command.setWhatsThis("")
|
||||
self.btn_copy_adis_command.setAccessibleDescription("")
|
||||
self.btn_copy_adis_command.setAutoFillBackground(False)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap("c:\\Users\\aky547\\GitHub\\SemesterapparatsManager\\src\\ui\\../../../.designer/backup/icons/information.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.btn_copy_adis_command.setIcon(icon)
|
||||
icon1 = QtGui.QIcon()
|
||||
icon1.addPixmap(QtGui.QPixmap("c:\\Users\\aky547\\GitHub\\SemesterapparatsManager\\src\\ui\\../../../../../../.designer/backup/icons/information.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.btn_copy_adis_command.setIcon(icon1)
|
||||
self.btn_copy_adis_command.setCheckable(False)
|
||||
self.btn_copy_adis_command.setChecked(False)
|
||||
self.btn_copy_adis_command.setAutoDefault(False)
|
||||
@@ -1205,7 +1172,7 @@ class Ui_MainWindow(object):
|
||||
self.label_total_day_messages.setObjectName("label_total_day_messages")
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1601, 30))
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1589, 22))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuDatei = QtWidgets.QMenu(parent=self.menubar)
|
||||
self.menuDatei.setObjectName("menuDatei")
|
||||
@@ -1235,30 +1202,30 @@ class Ui_MainWindow(object):
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
self.tabWidget_2.setCurrentIndex(1)
|
||||
self.stackedWidget_4.setCurrentIndex(1)
|
||||
self.tabWidget_3.setCurrentIndex(1)
|
||||
self.tabWidget_2.setCurrentIndex(0)
|
||||
self.stackedWidget_4.setCurrentIndex(0)
|
||||
self.tabWidget_3.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
MainWindow.setTabOrder(self.drpdwn_app_nr, self.drpdwn_prof_name)
|
||||
MainWindow.setTabOrder(self.drpdwn_app_nr, self.prof_title)
|
||||
MainWindow.setTabOrder(self.prof_title, self.drpdwn_prof_name)
|
||||
MainWindow.setTabOrder(self.drpdwn_prof_name, self.prof_mail)
|
||||
MainWindow.setTabOrder(self.prof_mail, self.prof_tel_nr)
|
||||
MainWindow.setTabOrder(self.prof_tel_nr, self.app_name)
|
||||
MainWindow.setTabOrder(self.app_name, self.sem_year)
|
||||
MainWindow.setTabOrder(self.app_name, self.app_fach)
|
||||
MainWindow.setTabOrder(self.app_fach, self.sem_year)
|
||||
MainWindow.setTabOrder(self.sem_year, self.check_eternal_app)
|
||||
MainWindow.setTabOrder(self.check_eternal_app, self.btn_add_document)
|
||||
MainWindow.setTabOrder(self.btn_add_document, self.btn_open_document)
|
||||
MainWindow.setTabOrder(self.btn_open_document, self.check_file)
|
||||
MainWindow.setTabOrder(self.check_file, self.btn_apparat_save)
|
||||
MainWindow.setTabOrder(self.check_file, self.check_send_mail)
|
||||
MainWindow.setTabOrder(self.check_send_mail, self.btn_apparat_save)
|
||||
MainWindow.setTabOrder(self.btn_apparat_save, self.btn_apparat_apply)
|
||||
MainWindow.setTabOrder(self.btn_apparat_apply, self.check_send_mail)
|
||||
MainWindow.setTabOrder(self.check_send_mail, self.chkbx_show_del_media)
|
||||
MainWindow.setTabOrder(self.chkbx_show_del_media, self.btn_reserve)
|
||||
MainWindow.setTabOrder(self.btn_reserve, self.prof_id_adis)
|
||||
MainWindow.setTabOrder(self.btn_apparat_apply, self.prof_id_adis)
|
||||
MainWindow.setTabOrder(self.prof_id_adis, self.apparat_id_adis)
|
||||
MainWindow.setTabOrder(self.apparat_id_adis, self.tabWidget_2)
|
||||
MainWindow.setTabOrder(self.tabWidget_2, self.btn_del_select_apparats)
|
||||
MainWindow.setTabOrder(self.btn_del_select_apparats, self.tabWidget_3)
|
||||
MainWindow.setTabOrder(self.tabWidget_3, self.select_action_box)
|
||||
MainWindow.setTabOrder(self.tabWidget_2, self.seach_by_signature)
|
||||
MainWindow.setTabOrder(self.seach_by_signature, self.search_by_title)
|
||||
MainWindow.setTabOrder(self.search_by_title, self.select_action_box)
|
||||
MainWindow.setTabOrder(self.select_action_box, self.user_create_frame_username)
|
||||
MainWindow.setTabOrder(self.user_create_frame_username, self.user_frame_userrole)
|
||||
MainWindow.setTabOrder(self.user_frame_userrole, self.user_create_frame_password)
|
||||
@@ -1272,9 +1239,7 @@ class Ui_MainWindow(object):
|
||||
MainWindow.setTabOrder(self.user_edit_frame_new_password, self.update_user)
|
||||
MainWindow.setTabOrder(self.update_user, self.edit_faculty_member_title)
|
||||
MainWindow.setTabOrder(self.edit_faculty_member_title, self.edit_faculty_member_select_member)
|
||||
MainWindow.setTabOrder(self.edit_faculty_member_select_member, self.faculty_member_old_telnr)
|
||||
MainWindow.setTabOrder(self.faculty_member_old_telnr, self.faculty_member_oldmail)
|
||||
MainWindow.setTabOrder(self.faculty_member_oldmail, self.edit_faculty_member_new_title)
|
||||
MainWindow.setTabOrder(self.edit_faculty_member_select_member, self.edit_faculty_member_new_title)
|
||||
MainWindow.setTabOrder(self.edit_faculty_member_new_title, self.edit_faculty_member_new_surname)
|
||||
MainWindow.setTabOrder(self.edit_faculty_member_new_surname, self.user_faculty_member_new_name)
|
||||
MainWindow.setTabOrder(self.user_faculty_member_new_name, self.user_faculty_member_new_mail)
|
||||
@@ -1290,6 +1255,12 @@ class Ui_MainWindow(object):
|
||||
MainWindow.setTabOrder(self.box_dauerapp, self.box_appnrs)
|
||||
MainWindow.setTabOrder(self.box_appnrs, self.btn_copy_adis_command)
|
||||
MainWindow.setTabOrder(self.btn_copy_adis_command, self.spin_select_message)
|
||||
MainWindow.setTabOrder(self.spin_select_message, self.chkbx_show_del_media)
|
||||
MainWindow.setTabOrder(self.chkbx_show_del_media, self.btn_reserve)
|
||||
MainWindow.setTabOrder(self.btn_reserve, self.book_search)
|
||||
MainWindow.setTabOrder(self.book_search, self.btn_del_select_apparats)
|
||||
MainWindow.setTabOrder(self.btn_del_select_apparats, self.tabWidget_3)
|
||||
MainWindow.setTabOrder(self.tabWidget_3, self.book_search_result)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
@@ -1298,7 +1269,7 @@ class Ui_MainWindow(object):
|
||||
self.load_app.setText(_translate("MainWindow", "App. aufrufen"))
|
||||
self.create_new_app.setText(_translate("MainWindow", "neu. App anlegen"))
|
||||
self.cancel_active_selection.setText(_translate("MainWindow", "Auswahl abbrechen"))
|
||||
self.tableWidget_apparate.setSortingEnabled(True)
|
||||
self.tableWidget_apparate.setSortingEnabled(False)
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "AppNr"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(1)
|
||||
|
||||
@@ -84,4 +84,3 @@ class Ui_Wizard(object):
|
||||
self.label_3.setText(_translate("Wizard", "Save Path"))
|
||||
self.save_path.setPlaceholderText(_translate("Wizard", "~/Desktop/SemapFiles"))
|
||||
self.btn_save_path_select.setText(_translate("Wizard", "..."))
|
||||
|
||||
|
||||
@@ -8,20 +8,15 @@ from .dialogs import (
|
||||
fileparser_ui,
|
||||
login_ui,
|
||||
medienadder_ui,
|
||||
new_subject_ui,
|
||||
parsed_titles_ui,
|
||||
popus_confirm,
|
||||
reminder_ui,
|
||||
settings_ui,
|
||||
new_subject_ui,
|
||||
)
|
||||
from .Ui_semesterapparat_ui import Ui_MainWindow as Ui_Semesterapparat
|
||||
from .Ui_setupwizard import Ui_Wizard as SetupWizard
|
||||
from .widgets import (
|
||||
FilePicker,
|
||||
GraphWidget,
|
||||
Message_Widget,
|
||||
StatusWidget,
|
||||
)
|
||||
from .widgets import FilePicker, GraphWidget, Message_Widget, StatusWidget
|
||||
|
||||
path = pathlib.Path(__file__).parent.absolute()
|
||||
# from .mainwindow import Ui_MainWindow as Ui_MainWindow
|
||||
|
||||
1
src/ui/icons/email.svg
Normal file
1
src/ui/icons/email.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#CCD6DD" d="M36 27c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V9c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v18z"/><path fill="#99AAB5" d="M11.95 17.636L.637 28.949c-.027.028-.037.063-.06.091.34.57.814 1.043 1.384 1.384.029-.023.063-.033.09-.06L13.365 19.05c.39-.391.39-1.023 0-1.414-.392-.391-1.024-.391-1.415 0M35.423 29.04c-.021-.028-.033-.063-.06-.09L24.051 17.636c-.392-.391-1.024-.391-1.415 0s-.391 1.023 0 1.414l11.313 11.314c.026.026.062.037.09.06.571-.34 1.044-.814 1.384-1.384"/><path fill="#99AAB5" d="M32 5H4C1.791 5 0 6.791 0 9v1.03l14.528 14.496c1.894 1.893 4.988 1.893 6.884 0L36 10.009V9c0-2.209-1.791-4-4-4z"/><path fill="#E1E8ED" d="M32 5H4C2.412 5 1.051 5.934.405 7.275l14.766 14.767c1.562 1.562 4.096 1.562 5.657 0L35.595 7.275C34.949 5.934 33.589 5 32 5z"/><path fill="#66757F" d="M15 9.27c0-.73.365-1.27 1-1.27h3.62c.839 0 1.174.49 1.174 1 0 .496-.349 1-1.035 1h-2.708v2h2.533c.716 0 1.065.489 1.065 1 0 .496-.366 1-1.065 1h-2.533v2h2.84c.699 0 1.037.489 1.037 1 0 .496-.353 1-1.037 1h-3.766C15.482 18 15 17.469 15 16.812V9.27z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
1
src/ui/icons/locked.svg
Normal file
1
src/ui/icons/locked.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#AAB8C2" d="M13 3C7.477 3 3 7.477 3 13v10h4V13c0-3.313 2.687-6 6-6s6 2.687 6 6v10h4V13c0-5.523-4.477-10-10-10z"/><path fill="#FFAC33" d="M26 32c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V20c0-2.209 1.791-4 4-4h18c2.209 0 4 1.791 4 4v12z"/><path fill="#C1694F" d="M35 9c0-4.971-4.029-9-9-9s-9 4.029-9 9c0 3.917 2.507 7.24 6 8.477V33.5c0 1.381 1.119 2.5 2.5 2.5 1.213 0 2.223-.864 2.45-2.01.018.001.032.01.05.01.553 0 1-.447 1-1v-1c0-.553-.447-1-1-1v-1c.553 0 1-.447 1-1v-2c0-.553-.447-1-1-1v-2.277c.596-.347 1-.984 1-1.723v-4.523c3.493-1.236 6-4.559 6-8.477zm-9-7c1.104 0 2 .896 2 2s-.896 2-2 2-2-.896-2-2 .896-2 2-2z"/></svg>
|
||||
|
After Width: | Height: | Size: 697 B |
BIN
src/ui/icons/logo.ico
Normal file
BIN
src/ui/icons/logo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
1
src/ui/icons/plus.svg
Normal file
1
src/ui/icons/plus.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#31373D" d="M31 15H21V5c0-1.657-1.343-3-3-3s-3 1.343-3 3v10H5c-1.657 0-3 1.343-3 3s1.343 3 3 3h10v10c0 1.657 1.343 3 3 3s3-1.343 3-3V21h10c1.657 0 3-1.343 3-3s-1.343-3-3-3z"/></svg>
|
||||
|
After Width: | Height: | Size: 253 B |
@@ -1,28 +1,35 @@
|
||||
# Form implementation generated from reading ui file 'untitled.ui'
|
||||
#
|
||||
# Created by: PySide6 UI code generator 6.3.1
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(1280, 720)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
|
||||
MainWindow.setSizePolicy(sizePolicy)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.centralwidget.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.centralwidget.setSizePolicy(sizePolicy)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
|
||||
@@ -38,7 +45,10 @@ class Ui_MainWindow(object):
|
||||
self.tabWidget = QtWidgets.QTabWidget(self.verticalLayoutWidget)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Preferred,
|
||||
QtWidgets.QSizePolicy.Policy.Preferred,
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth())
|
||||
@@ -54,7 +64,12 @@ class Ui_MainWindow(object):
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
40,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.load_app = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.load_app.setObjectName("load_app")
|
||||
@@ -62,10 +77,19 @@ class Ui_MainWindow(object):
|
||||
self.create_new_app = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.create_new_app.setObjectName("create_new_app")
|
||||
self.verticalLayout_2.addWidget(self.create_new_app)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
40,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
self.verticalLayout_2.addItem(spacerItem1)
|
||||
self.formLayout.setLayout(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2)
|
||||
self.tableWidget_apparate = QtWidgets.QTableWidget(self.horizontalLayoutWidget_2)
|
||||
self.formLayout.setLayout(
|
||||
0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2
|
||||
)
|
||||
self.tableWidget_apparate = QtWidgets.QTableWidget(
|
||||
self.horizontalLayoutWidget_2
|
||||
)
|
||||
self.tableWidget_apparate.setObjectName("tableWidget_apparate")
|
||||
self.tableWidget_apparate.setColumnCount(4)
|
||||
self.tableWidget_apparate.setRowCount(0)
|
||||
@@ -77,13 +101,19 @@ class Ui_MainWindow(object):
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(3, item)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate)
|
||||
self.formLayout.setWidget(
|
||||
0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate
|
||||
)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.formLayout.setLayout(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.horizontalLayout_3)
|
||||
self.formLayout.setLayout(
|
||||
2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.horizontalLayout_3
|
||||
)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4)
|
||||
self.formLayout.setLayout(
|
||||
1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4
|
||||
)
|
||||
self.horizontalLayout_2.addLayout(self.formLayout)
|
||||
self.line = QtWidgets.QFrame(self.tab)
|
||||
self.line.setGeometry(QtCore.QRect(0, 160, 1261, 21))
|
||||
@@ -118,17 +148,26 @@ class Ui_MainWindow(object):
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1)
|
||||
self.app_group_box = QtWidgets.QGroupBox(self.gridLayoutWidget_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Preferred,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth())
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.app_group_box.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.app_group_box.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.app_group_box.setFont(font)
|
||||
self.app_group_box.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||
self.app_group_box.setAlignment(
|
||||
QtCore.Qt.AlignmentFlag.AlignLeading
|
||||
| QtCore.Qt.AlignmentFlag.AlignLeft
|
||||
| QtCore.Qt.AlignmentFlag.AlignVCenter
|
||||
)
|
||||
self.app_group_box.setCheckable(False)
|
||||
self.app_group_box.setObjectName("app_group_box")
|
||||
self.tableWidget = QtWidgets.QTableWidget(self.app_group_box)
|
||||
@@ -142,7 +181,9 @@ class Ui_MainWindow(object):
|
||||
self.tableWidget.setHorizontalHeaderItem(1, item)
|
||||
self.frame = QtWidgets.QFrame(self.app_group_box)
|
||||
self.frame.setGeometry(QtCore.QRect(10, 30, 731, 151))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
|
||||
@@ -304,7 +345,9 @@ class Ui_MainWindow(object):
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
self.load_app.setToolTip(_translate("MainWindow", "Load the Semesterapparate from the database"))
|
||||
self.load_app.setToolTip(
|
||||
_translate("MainWindow", "Load the Semesterapparate from the database")
|
||||
)
|
||||
self.load_app.setText(_translate("MainWindow", "App. Laden"))
|
||||
self.create_new_app.setText(_translate("MainWindow", "neu. App anlegen"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(0)
|
||||
@@ -344,14 +387,19 @@ class Ui_MainWindow(object):
|
||||
self.btn_add_document.setText(_translate("MainWindow", "Dokument hinzufügen"))
|
||||
self.btn_open_document.setText(_translate("MainWindow", "Dokument öffnen"))
|
||||
self.toolButton.setText(_translate("MainWindow", "..."))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Tab 1"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Tab 2"))
|
||||
self.tabWidget.setTabText(
|
||||
self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Tab 1")
|
||||
)
|
||||
self.tabWidget.setTabText(
|
||||
self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Tab 2")
|
||||
)
|
||||
self.menuDatei.setTitle(_translate("MainWindow", "Datei"))
|
||||
self.menuEinstellungen.setTitle(_translate("MainWindow", "Einstellungen"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
MainWindow = QtWidgets.QMainWindow()
|
||||
ui = Ui_MainWindow()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Created by: The Resource Compiler for Qt version 6.6.2
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PySide6 import QtCore
|
||||
from PyQt6 import QtCore
|
||||
|
||||
qt_resource_data = b"\
|
||||
\x00\x00\x00\xde\
|
||||
@@ -131,25 +131,32 @@ qt_resource_struct = b"\
|
||||
\x00\x00\x00b\x00\x02\x00\x00\x00\x01\x00\x00\x00\x06\
|
||||
\x00\x00\x00\x00\x00\x00\x00\x00\
|
||||
\x00\x00\x00\xd0\x00\x00\x00\x00\x00\x01\x00\x00\x02\xdb\
|
||||
\x00\x00\x01\x8d\xabem#\
|
||||
\x00\x00\x01\x8e,\x5c5%\
|
||||
\x00\x00\x00b\x00\x02\x00\x00\x00\x01\x00\x00\x00\x08\
|
||||
\x00\x00\x00\x00\x00\x00\x00\x00\
|
||||
\x00\x00\x00\x8e\x00\x00\x00\x00\x00\x01\x00\x00\x00\xe2\
|
||||
\x00\x00\x01\x8d\xabem!\
|
||||
\x00\x00\x01\x8e,\x5c5\x22\
|
||||
\x00\x00\x00b\x00\x02\x00\x00\x00\x01\x00\x00\x00\x0a\
|
||||
\x00\x00\x00\x00\x00\x00\x00\x00\
|
||||
\x00\x00\x00\xb2\x00\x00\x00\x00\x00\x01\x00\x00\x01\xdb\
|
||||
\x00\x00\x01\x8d\xabem!\
|
||||
\x00\x00\x01\x8e,\x5c5!\
|
||||
\x00\x00\x00b\x00\x02\x00\x00\x00\x01\x00\x00\x00\x0c\
|
||||
\x00\x00\x00\x00\x00\x00\x00\x00\
|
||||
\x00\x00\x00r\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
|
||||
\x00\x00\x01\x8d\xabem#\
|
||||
\x00\x00\x01\x8e,\x5c5'\
|
||||
"
|
||||
|
||||
|
||||
def qInitResources():
|
||||
QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
|
||||
QtCore.qRegisterResourceData(
|
||||
0x03, qt_resource_struct, qt_resource_name, qt_resource_data
|
||||
)
|
||||
|
||||
|
||||
def qCleanupResources():
|
||||
QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
|
||||
QtCore.qUnregisterResourceData(
|
||||
0x03, qt_resource_struct, qt_resource_name, qt_resource_data
|
||||
)
|
||||
|
||||
|
||||
qInitResources()
|
||||
|
||||
111
src/ui/sap.py
111
src/ui/sap.py
@@ -1,28 +1,35 @@
|
||||
# Form implementation generated from reading ui file 'ui/semesterapparat_ui.ui'
|
||||
#
|
||||
# Created by: PySide6 UI code generator 6.3.1
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(1280, 747)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
|
||||
MainWindow.setSizePolicy(sizePolicy)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.centralwidget.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.centralwidget.setSizePolicy(sizePolicy)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
|
||||
@@ -39,7 +46,10 @@ class Ui_MainWindow(object):
|
||||
self.tabWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Preferred,
|
||||
QtWidgets.QSizePolicy.Policy.Preferred,
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth())
|
||||
@@ -55,7 +65,12 @@ class Ui_MainWindow(object):
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
40,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.load_app = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.load_app.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
@@ -65,12 +80,23 @@ class Ui_MainWindow(object):
|
||||
self.create_new_app.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.create_new_app.setObjectName("create_new_app")
|
||||
self.verticalLayout_2.addWidget(self.create_new_app)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
40,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
self.verticalLayout_2.addItem(spacerItem1)
|
||||
self.formLayout.setLayout(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2)
|
||||
self.tableWidget_apparate = QtWidgets.QTableWidget(self.horizontalLayoutWidget_2)
|
||||
self.formLayout.setLayout(
|
||||
0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2
|
||||
)
|
||||
self.tableWidget_apparate = QtWidgets.QTableWidget(
|
||||
self.horizontalLayoutWidget_2
|
||||
)
|
||||
self.tableWidget_apparate.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tableWidget_apparate.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.tableWidget_apparate.setEditTriggers(
|
||||
QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers
|
||||
)
|
||||
self.tableWidget_apparate.setObjectName("tableWidget_apparate")
|
||||
self.tableWidget_apparate.setColumnCount(4)
|
||||
self.tableWidget_apparate.setRowCount(0)
|
||||
@@ -82,13 +108,19 @@ class Ui_MainWindow(object):
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(3, item)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate)
|
||||
self.formLayout.setWidget(
|
||||
0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate
|
||||
)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.formLayout.setLayout(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.horizontalLayout_3)
|
||||
self.formLayout.setLayout(
|
||||
2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.horizontalLayout_3
|
||||
)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4)
|
||||
self.formLayout.setLayout(
|
||||
1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4
|
||||
)
|
||||
self.horizontalLayout_2.addLayout(self.formLayout)
|
||||
self.line = QtWidgets.QFrame(self.tab)
|
||||
self.line.setGeometry(QtCore.QRect(0, 160, 1261, 21))
|
||||
@@ -102,17 +134,26 @@ class Ui_MainWindow(object):
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.app_group_box = QtWidgets.QGroupBox(self.gridLayoutWidget_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Preferred,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth())
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.app_group_box.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.app_group_box.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.app_group_box.setFont(font)
|
||||
self.app_group_box.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||
self.app_group_box.setAlignment(
|
||||
QtCore.Qt.AlignmentFlag.AlignLeading
|
||||
| QtCore.Qt.AlignmentFlag.AlignLeft
|
||||
| QtCore.Qt.AlignmentFlag.AlignVCenter
|
||||
)
|
||||
self.app_group_box.setCheckable(False)
|
||||
self.app_group_box.setObjectName("app_group_box")
|
||||
self.dokument_list = QtWidgets.QTableWidget(self.app_group_box)
|
||||
@@ -121,7 +162,9 @@ class Ui_MainWindow(object):
|
||||
font.setKerning(False)
|
||||
self.dokument_list.setFont(font)
|
||||
self.dokument_list.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.dokument_list.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
|
||||
self.dokument_list.setSelectionMode(
|
||||
QtWidgets.QAbstractItemView.SelectionMode.SingleSelection
|
||||
)
|
||||
self.dokument_list.setObjectName("dokument_list")
|
||||
self.dokument_list.setColumnCount(4)
|
||||
self.dokument_list.setRowCount(0)
|
||||
@@ -148,7 +191,9 @@ class Ui_MainWindow(object):
|
||||
self.frame = QtWidgets.QFrame(self.app_group_box)
|
||||
self.frame.setEnabled(True)
|
||||
self.frame.setGeometry(QtCore.QRect(10, 30, 731, 151))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
|
||||
@@ -331,7 +376,9 @@ class Ui_MainWindow(object):
|
||||
self.drpdwn_prof_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.drpdwn_prof_name.setEditable(True)
|
||||
self.drpdwn_prof_name.setCurrentText("")
|
||||
self.drpdwn_prof_name.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
||||
self.drpdwn_prof_name.setInsertPolicy(
|
||||
QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically
|
||||
)
|
||||
self.drpdwn_prof_name.setFrame(True)
|
||||
self.drpdwn_prof_name.setObjectName("drpdwn_prof_name")
|
||||
self.btn_add_document = QtWidgets.QPushButton(self.app_group_box)
|
||||
@@ -445,7 +492,9 @@ class Ui_MainWindow(object):
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
self.load_app.setToolTip(_translate("MainWindow", "Load the Semesterapparate from the database"))
|
||||
self.load_app.setToolTip(
|
||||
_translate("MainWindow", "Load the Semesterapparate from the database")
|
||||
)
|
||||
self.load_app.setText(_translate("MainWindow", "App. aufrufen"))
|
||||
self.create_new_app.setText(_translate("MainWindow", "neu. App anlegen"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(0)
|
||||
@@ -483,7 +532,9 @@ class Ui_MainWindow(object):
|
||||
self.btn_open_document.setText(_translate("MainWindow", "Dokument öffnen"))
|
||||
self.toolButton.setText(_translate("MainWindow", "..."))
|
||||
self.label_7.setText(_translate("MainWindow", "Suche"))
|
||||
self.search_media.setPlaceholderText(_translate("MainWindow", "Buch oder Signatur"))
|
||||
self.search_media.setPlaceholderText(
|
||||
_translate("MainWindow", "Buch oder Signatur")
|
||||
)
|
||||
self.label.setText(_translate("MainWindow", "Medienliste"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "Buchtitel"))
|
||||
@@ -493,17 +544,27 @@ class Ui_MainWindow(object):
|
||||
item.setText(_translate("MainWindow", "Auflage"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(3)
|
||||
item.setText(_translate("MainWindow", "Signatur"))
|
||||
self.search.setToolTip(_translate("MainWindow", "Sucht im Katalog nach allen Medien, die die Apparatsnummer enthalten"))
|
||||
self.search.setToolTip(
|
||||
_translate(
|
||||
"MainWindow",
|
||||
"Sucht im Katalog nach allen Medien, die die Apparatsnummer enthalten",
|
||||
)
|
||||
)
|
||||
self.search.setText(_translate("MainWindow", "Suche"))
|
||||
self.add_medium.setText(_translate("MainWindow", "Medium hinzufügen"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Tab 1"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Tab 2"))
|
||||
self.tabWidget.setTabText(
|
||||
self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Tab 1")
|
||||
)
|
||||
self.tabWidget.setTabText(
|
||||
self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Tab 2")
|
||||
)
|
||||
self.menuDatei.setTitle(_translate("MainWindow", "Datei"))
|
||||
self.menuEinstellungen.setTitle(_translate("MainWindow", "Einstellungen"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
MainWindow = QtWidgets.QMainWindow()
|
||||
ui = Ui_MainWindow()
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
<property name="windowTitle">
|
||||
<string>Semesterapparatsmanagement</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>../../icons/logo.ico</normaloff>../../icons/logo.ico</iconset>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string/>
|
||||
</property>
|
||||
@@ -70,7 +74,7 @@
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<property name="sizePolicy">
|
||||
@@ -166,7 +170,7 @@
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::SelectedClicked</set>
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
@@ -175,7 +179,7 @@
|
||||
<enum>Qt::ElideMiddle</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||
<bool>true</bool>
|
||||
@@ -986,6 +990,12 @@
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhPreferNumbers</set>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
@@ -1002,7 +1012,17 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="apparat_id_adis"/>
|
||||
<widget class="QLineEdit" name="apparat_id_adis">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhPreferNumbers</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -1402,7 +1422,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
@@ -1646,7 +1666,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_6">
|
||||
<attribute name="title">
|
||||
@@ -1791,6 +1811,9 @@
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
@@ -2613,7 +2636,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../../../../../.designer/backup/icons/information.png</normaloff>../../../../../.designer/backup/icons/information.png</iconset>
|
||||
<normaloff>../../../../../../.designer/backup/icons/information.png</normaloff>../../../../../../.designer/backup/icons/information.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
@@ -2892,6 +2915,8 @@
|
||||
<tabstop>tabWidget_3</tabstop>
|
||||
<tabstop>book_search_result</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -149,5 +149,3 @@ class Ui_Wizard(object):
|
||||
)
|
||||
|
||||
# retranslateUi
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/sounds/semesterapparat_ui.ui'
|
||||
#
|
||||
# Created by: PySide6 UI code generator 6.5.3
|
||||
# Created by: PyQt6 UI code generator 6.5.3
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
@@ -15,7 +15,9 @@ class Ui_MainWindow(object):
|
||||
MainWindow.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
|
||||
MainWindow.setEnabled(True)
|
||||
MainWindow.resize(1593, 800)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
|
||||
@@ -24,10 +26,14 @@ class Ui_MainWindow(object):
|
||||
MainWindow.setMaximumSize(QtCore.QSize(1920, 800))
|
||||
MainWindow.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.NoContextMenu)
|
||||
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.centralwidget.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.centralwidget.setSizePolicy(sizePolicy)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(parent=self.centralwidget)
|
||||
@@ -44,7 +50,10 @@ class Ui_MainWindow(object):
|
||||
self.tabWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Preferred,
|
||||
QtWidgets.QSizePolicy.Policy.Preferred,
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth())
|
||||
@@ -60,26 +69,48 @@ class Ui_MainWindow(object):
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
40,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.load_app = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_2)
|
||||
self.load_app.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.load_app.setObjectName("load_app")
|
||||
self.verticalLayout_2.addWidget(self.load_app)
|
||||
self.create_new_app = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_2)
|
||||
self.create_new_app = QtWidgets.QPushButton(
|
||||
parent=self.horizontalLayoutWidget_2
|
||||
)
|
||||
self.create_new_app.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.create_new_app.setObjectName("create_new_app")
|
||||
self.verticalLayout_2.addWidget(self.create_new_app)
|
||||
self.cancel_active_selection = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_2)
|
||||
self.cancel_active_selection = QtWidgets.QPushButton(
|
||||
parent=self.horizontalLayoutWidget_2
|
||||
)
|
||||
self.cancel_active_selection.setObjectName("cancel_active_selection")
|
||||
self.verticalLayout_2.addWidget(self.cancel_active_selection)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
40,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
self.verticalLayout_2.addItem(spacerItem1)
|
||||
self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2)
|
||||
self.tableWidget_apparate = QtWidgets.QTableWidget(parent=self.horizontalLayoutWidget_2)
|
||||
self.formLayout.setLayout(
|
||||
1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2
|
||||
)
|
||||
self.tableWidget_apparate = QtWidgets.QTableWidget(
|
||||
parent=self.horizontalLayoutWidget_2
|
||||
)
|
||||
self.tableWidget_apparate.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tableWidget_apparate.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents)
|
||||
self.tableWidget_apparate.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.SelectedClicked)
|
||||
self.tableWidget_apparate.setSizeAdjustPolicy(
|
||||
QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents
|
||||
)
|
||||
self.tableWidget_apparate.setEditTriggers(
|
||||
QtWidgets.QAbstractItemView.EditTrigger.SelectedClicked
|
||||
)
|
||||
self.tableWidget_apparate.setAlternatingRowColors(True)
|
||||
self.tableWidget_apparate.setTextElideMode(QtCore.Qt.TextElideMode.ElideMiddle)
|
||||
self.tableWidget_apparate.setObjectName("tableWidget_apparate")
|
||||
@@ -98,13 +129,19 @@ class Ui_MainWindow(object):
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(5, item)
|
||||
self.tableWidget_apparate.horizontalHeader().setCascadingSectionResizes(True)
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate)
|
||||
self.formLayout.setWidget(
|
||||
1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate
|
||||
)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.formLayout.setLayout(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4)
|
||||
self.formLayout.setLayout(
|
||||
2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4
|
||||
)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.formLayout.setLayout(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.horizontalLayout_3)
|
||||
self.formLayout.setLayout(
|
||||
3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.horizontalLayout_3
|
||||
)
|
||||
self.horizontalLayout_2.addLayout(self.formLayout)
|
||||
self.line = QtWidgets.QFrame(parent=self.tab)
|
||||
self.line.setGeometry(QtCore.QRect(0, 160, 1261, 21))
|
||||
@@ -119,10 +156,14 @@ class Ui_MainWindow(object):
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.app_group_box = QtWidgets.QGroupBox(parent=self.gridLayoutWidget_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth())
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.app_group_box.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.app_group_box.setSizePolicy(sizePolicy)
|
||||
self.app_group_box.setMinimumSize(QtCore.QSize(0, 210))
|
||||
font = QtGui.QFont()
|
||||
@@ -130,7 +171,11 @@ class Ui_MainWindow(object):
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.app_group_box.setFont(font)
|
||||
self.app_group_box.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||
self.app_group_box.setAlignment(
|
||||
QtCore.Qt.AlignmentFlag.AlignLeading
|
||||
| QtCore.Qt.AlignmentFlag.AlignLeft
|
||||
| QtCore.Qt.AlignmentFlag.AlignVCenter
|
||||
)
|
||||
self.app_group_box.setCheckable(False)
|
||||
self.app_group_box.setObjectName("app_group_box")
|
||||
self.dokument_list = QtWidgets.QTableWidget(parent=self.app_group_box)
|
||||
@@ -143,11 +188,17 @@ class Ui_MainWindow(object):
|
||||
self.dokument_list.setFont(font)
|
||||
self.dokument_list.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.dokument_list.setAcceptDrops(True)
|
||||
self.dokument_list.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents)
|
||||
self.dokument_list.setSizeAdjustPolicy(
|
||||
QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents
|
||||
)
|
||||
self.dokument_list.setDragEnabled(True)
|
||||
self.dokument_list.setDragDropMode(QtWidgets.QAbstractItemView.DragDropMode.DropOnly)
|
||||
self.dokument_list.setDragDropMode(
|
||||
QtWidgets.QAbstractItemView.DragDropMode.DropOnly
|
||||
)
|
||||
self.dokument_list.setDefaultDropAction(QtCore.Qt.DropAction.LinkAction)
|
||||
self.dokument_list.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
|
||||
self.dokument_list.setSelectionMode(
|
||||
QtWidgets.QAbstractItemView.SelectionMode.SingleSelection
|
||||
)
|
||||
self.dokument_list.setObjectName("dokument_list")
|
||||
self.dokument_list.setColumnCount(4)
|
||||
self.dokument_list.setRowCount(0)
|
||||
@@ -174,7 +225,9 @@ class Ui_MainWindow(object):
|
||||
self.frame = QtWidgets.QFrame(parent=self.app_group_box)
|
||||
self.frame.setEnabled(True)
|
||||
self.frame.setGeometry(QtCore.QRect(10, 30, 1241, 151))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
|
||||
@@ -317,7 +370,9 @@ class Ui_MainWindow(object):
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.prof_mail.setFont(font)
|
||||
self.prof_mail.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly)
|
||||
self.prof_mail.setInputMethodHints(
|
||||
QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly
|
||||
)
|
||||
self.prof_mail.setMaxLength(200)
|
||||
self.prof_mail.setPlaceholderText("")
|
||||
self.prof_mail.setObjectName("prof_mail")
|
||||
@@ -366,7 +421,9 @@ class Ui_MainWindow(object):
|
||||
self.drpdwn_prof_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.drpdwn_prof_name.setEditable(True)
|
||||
self.drpdwn_prof_name.setCurrentText("")
|
||||
self.drpdwn_prof_name.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
||||
self.drpdwn_prof_name.setInsertPolicy(
|
||||
QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically
|
||||
)
|
||||
self.drpdwn_prof_name.setFrame(True)
|
||||
self.drpdwn_prof_name.setObjectName("drpdwn_prof_name")
|
||||
self.mail_mand = QtWidgets.QLabel(parent=self.frame)
|
||||
@@ -455,7 +512,9 @@ class Ui_MainWindow(object):
|
||||
font.setWeight(50)
|
||||
self.label_12.setFont(font)
|
||||
self.label_12.setObjectName("label_12")
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_12)
|
||||
self.formLayout_3.setWidget(
|
||||
0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_12
|
||||
)
|
||||
self.prof_id_adis = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
@@ -463,7 +522,9 @@ class Ui_MainWindow(object):
|
||||
font.setWeight(50)
|
||||
self.prof_id_adis.setFont(font)
|
||||
self.prof_id_adis.setObjectName("prof_id_adis")
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.prof_id_adis)
|
||||
self.formLayout_3.setWidget(
|
||||
0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.prof_id_adis
|
||||
)
|
||||
self.label_13 = QtWidgets.QLabel(parent=self.formLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
@@ -471,10 +532,14 @@ class Ui_MainWindow(object):
|
||||
font.setWeight(50)
|
||||
self.label_13.setFont(font)
|
||||
self.label_13.setObjectName("label_13")
|
||||
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_13)
|
||||
self.formLayout_3.setWidget(
|
||||
1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_13
|
||||
)
|
||||
self.apparat_id_adis = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2)
|
||||
self.apparat_id_adis.setObjectName("apparat_id_adis")
|
||||
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.apparat_id_adis)
|
||||
self.formLayout_3.setWidget(
|
||||
1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.apparat_id_adis
|
||||
)
|
||||
self.check_send_mail = QtWidgets.QCheckBox(parent=self.frame)
|
||||
self.check_send_mail.setGeometry(QtCore.QRect(450, 120, 91, 17))
|
||||
font = QtGui.QFont()
|
||||
@@ -518,19 +583,33 @@ class Ui_MainWindow(object):
|
||||
self.frame.raise_()
|
||||
self.dokument_list.raise_()
|
||||
self.gridLayout_2.addWidget(self.app_group_box, 1, 0, 1, 1)
|
||||
self.tableWidget_apparat_media = QtWidgets.QTableWidget(parent=self.gridLayoutWidget_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.tableWidget_apparat_media = QtWidgets.QTableWidget(
|
||||
parent=self.gridLayoutWidget_2
|
||||
)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tableWidget_apparat_media.sizePolicy().hasHeightForWidth())
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.tableWidget_apparat_media.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.tableWidget_apparat_media.setSizePolicy(sizePolicy)
|
||||
self.tableWidget_apparat_media.setMinimumSize(QtCore.QSize(1259, 0))
|
||||
self.tableWidget_apparat_media.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tableWidget_apparat_media.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
self.tableWidget_apparat_media.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents)
|
||||
self.tableWidget_apparat_media.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.tableWidget_apparat_media.setContextMenuPolicy(
|
||||
QtCore.Qt.ContextMenuPolicy.CustomContextMenu
|
||||
)
|
||||
self.tableWidget_apparat_media.setSizeAdjustPolicy(
|
||||
QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents
|
||||
)
|
||||
self.tableWidget_apparat_media.setEditTriggers(
|
||||
QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers
|
||||
)
|
||||
self.tableWidget_apparat_media.setAlternatingRowColors(True)
|
||||
self.tableWidget_apparat_media.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
|
||||
self.tableWidget_apparat_media.setSelectionBehavior(
|
||||
QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows
|
||||
)
|
||||
self.tableWidget_apparat_media.setObjectName("tableWidget_apparat_media")
|
||||
self.tableWidget_apparat_media.setColumnCount(7)
|
||||
self.tableWidget_apparat_media.setRowCount(0)
|
||||
@@ -548,7 +627,9 @@ class Ui_MainWindow(object):
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(5, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(6, item)
|
||||
self.tableWidget_apparat_media.horizontalHeader().setCascadingSectionResizes(True)
|
||||
self.tableWidget_apparat_media.horizontalHeader().setCascadingSectionResizes(
|
||||
True
|
||||
)
|
||||
self.gridLayout_2.addWidget(self.tableWidget_apparat_media, 9, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(parent=self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
@@ -560,12 +641,22 @@ class Ui_MainWindow(object):
|
||||
self.gridLayout_2.addWidget(self.label, 2, 0, 1, 1)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
20,
|
||||
QtWidgets.QSizePolicy.Policy.Fixed,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
)
|
||||
self.horizontalLayout_5.addItem(spacerItem2)
|
||||
self.chkbx_show_del_media = QtWidgets.QCheckBox(parent=self.gridLayoutWidget_2)
|
||||
self.chkbx_show_del_media.setObjectName("chkbx_show_del_media")
|
||||
self.horizontalLayout_5.addWidget(self.chkbx_show_del_media)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(
|
||||
40,
|
||||
20,
|
||||
QtWidgets.QSizePolicy.Policy.Fixed,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
)
|
||||
self.horizontalLayout_5.addItem(spacerItem3)
|
||||
self.add_layout = QtWidgets.QHBoxLayout()
|
||||
self.add_layout.setObjectName("add_layout")
|
||||
@@ -581,12 +672,22 @@ class Ui_MainWindow(object):
|
||||
self.progress_label.setObjectName("progress_label")
|
||||
self.add_layout.addWidget(self.progress_label)
|
||||
self.horizontalLayout_5.addLayout(self.add_layout)
|
||||
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
spacerItem4 = QtWidgets.QSpacerItem(
|
||||
40,
|
||||
20,
|
||||
QtWidgets.QSizePolicy.Policy.Fixed,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
)
|
||||
self.horizontalLayout_5.addItem(spacerItem4)
|
||||
self.btn_reserve = QtWidgets.QPushButton(parent=self.gridLayoutWidget_2)
|
||||
self.btn_reserve.setObjectName("btn_reserve")
|
||||
self.horizontalLayout_5.addWidget(self.btn_reserve)
|
||||
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
spacerItem5 = QtWidgets.QSpacerItem(
|
||||
40,
|
||||
20,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
)
|
||||
self.horizontalLayout_5.addItem(spacerItem5)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout_5, 4, 0, 1, 1)
|
||||
self.add_medium = QtWidgets.QPushButton(parent=self.tab)
|
||||
@@ -657,7 +758,12 @@ class Ui_MainWindow(object):
|
||||
self.box_person.setEditable(True)
|
||||
self.box_person.setObjectName("box_person")
|
||||
self.gridLayout_3.addWidget(self.box_person, 1, 1, 1, 1)
|
||||
spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
spacerItem6 = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
40,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
self.gridLayout_3.addItem(spacerItem6, 4, 0, 1, 1)
|
||||
self.label_15 = QtWidgets.QLabel(parent=self.gridLayoutWidget)
|
||||
self.label_15.setObjectName("label_15")
|
||||
@@ -675,7 +781,9 @@ class Ui_MainWindow(object):
|
||||
self.tab_4.setObjectName("tab_4")
|
||||
self.tabWidget_2.addTab(self.tab_4, "")
|
||||
self.verticalLayout_3.addWidget(self.tabWidget_2)
|
||||
self.stackedWidget_4 = QtWidgets.QStackedWidget(parent=self.verticalLayoutWidget_2)
|
||||
self.stackedWidget_4 = QtWidgets.QStackedWidget(
|
||||
parent=self.verticalLayoutWidget_2
|
||||
)
|
||||
self.stackedWidget_4.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.stackedWidget_4.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.stackedWidget_4.setObjectName("stackedWidget_4")
|
||||
@@ -688,13 +796,19 @@ class Ui_MainWindow(object):
|
||||
self.tab_6.setObjectName("tab_6")
|
||||
self.statistics_table = QtWidgets.QTableWidget(parent=self.tab_6)
|
||||
self.statistics_table.setGeometry(QtCore.QRect(0, 0, 435, 191))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.statistics_table.sizePolicy().hasHeightForWidth())
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.statistics_table.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.statistics_table.setSizePolicy(sizePolicy)
|
||||
self.statistics_table.setMaximumSize(QtCore.QSize(16777215, 191))
|
||||
self.statistics_table.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.statistics_table.setEditTriggers(
|
||||
QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers
|
||||
)
|
||||
self.statistics_table.setAlternatingRowColors(True)
|
||||
self.statistics_table.setObjectName("statistics_table")
|
||||
self.statistics_table.setColumnCount(3)
|
||||
@@ -722,17 +836,26 @@ class Ui_MainWindow(object):
|
||||
self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_3)
|
||||
self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||
self.btn_del_select_apparats = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_3)
|
||||
self.btn_del_select_apparats = QtWidgets.QPushButton(
|
||||
parent=self.horizontalLayoutWidget_3
|
||||
)
|
||||
self.btn_del_select_apparats.setObjectName("btn_del_select_apparats")
|
||||
self.horizontalLayout_7.addWidget(self.btn_del_select_apparats)
|
||||
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
spacerItem7 = QtWidgets.QSpacerItem(
|
||||
40,
|
||||
20,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
)
|
||||
self.horizontalLayout_7.addItem(spacerItem7)
|
||||
self.table = QtWidgets.QWidget(parent=self.widget)
|
||||
self.table.setGeometry(QtCore.QRect(0, 50, 761, 391))
|
||||
self.table.setObjectName("table")
|
||||
self.tableWidget = QtWidgets.QTableWidget(parent=self.table)
|
||||
self.tableWidget.setGeometry(QtCore.QRect(0, 0, 761, 391))
|
||||
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.tableWidget.setEditTriggers(
|
||||
QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers
|
||||
)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setColumnCount(5)
|
||||
self.tableWidget.setRowCount(0)
|
||||
@@ -761,14 +884,19 @@ class Ui_MainWindow(object):
|
||||
self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
|
||||
self.horizontalLayout_6.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||
self.frame_creation_progress = QtWidgets.QFrame(parent=self.horizontalLayoutWidget)
|
||||
self.frame_creation_progress = QtWidgets.QFrame(
|
||||
parent=self.horizontalLayoutWidget
|
||||
)
|
||||
self.frame_creation_progress.setObjectName("frame_creation_progress")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.frame_creation_progress)
|
||||
self.verticalLayout_4.setSpacing(6)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(parent=self.frame_creation_progress)
|
||||
self.groupBox_2.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
|
||||
@@ -800,7 +928,10 @@ class Ui_MainWindow(object):
|
||||
self.ids_check.setObjectName("ids_check")
|
||||
self.verticalLayout_4.addWidget(self.groupBox_2)
|
||||
self.groupBox = QtWidgets.QGroupBox(parent=self.frame_creation_progress)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -811,7 +942,7 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setItal # ic(False)
|
||||
font.setUnderline(False)
|
||||
font.setWeight(50)
|
||||
font.setKerning(True)
|
||||
@@ -823,7 +954,7 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setItal # ic(False)
|
||||
font.setUnderline(False)
|
||||
font.setWeight(50)
|
||||
font.setKerning(True)
|
||||
@@ -835,7 +966,7 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setItal # ic(False)
|
||||
font.setUnderline(False)
|
||||
font.setWeight(50)
|
||||
font.setKerning(True)
|
||||
@@ -847,7 +978,7 @@ class Ui_MainWindow(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setItal # ic(False)
|
||||
font.setUnderline(False)
|
||||
font.setWeight(50)
|
||||
font.setKerning(True)
|
||||
@@ -858,7 +989,13 @@ class Ui_MainWindow(object):
|
||||
self.btn_copy_adis_command.setAccessibleDescription("")
|
||||
self.btn_copy_adis_command.setAutoFillBackground(False)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap("/home/alexander/GitHub/Semesterapparate/ui/sounds/../../../.designer/backup/icons/information.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
icon.addPixmap(
|
||||
QtGui.QPixmap(
|
||||
"/home/alexander/GitHub/Semesterapparate/ui/sounds/../../../.designer/backup/icons/information.png"
|
||||
),
|
||||
QtGui.QIcon.Mode.Normal,
|
||||
QtGui.QIcon.State.Off,
|
||||
)
|
||||
self.btn_copy_adis_command.setIcon(icon)
|
||||
self.btn_copy_adis_command.setCheckable(False)
|
||||
self.btn_copy_adis_command.setChecked(False)
|
||||
@@ -874,7 +1011,9 @@ class Ui_MainWindow(object):
|
||||
self.calendarWidget = QtWidgets.QCalendarWidget(parent=self.frame_2)
|
||||
self.calendarWidget.setGeometry(QtCore.QRect(0, 0, 291, 191))
|
||||
self.calendarWidget.setGridVisible(True)
|
||||
self.calendarWidget.setVerticalHeaderFormat(QtWidgets.QCalendarWidget.VerticalHeaderFormat.NoVerticalHeader)
|
||||
self.calendarWidget.setVerticalHeaderFormat(
|
||||
QtWidgets.QCalendarWidget.VerticalHeaderFormat.NoVerticalHeader
|
||||
)
|
||||
self.calendarWidget.setObjectName("calendarWidget")
|
||||
self.message_frame = QtWidgets.QFrame(parent=self.frame_2)
|
||||
self.message_frame.setGeometry(QtCore.QRect(0, 210, 291, 121))
|
||||
@@ -946,11 +1085,17 @@ class Ui_MainWindow(object):
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "Semesterapparatsmanagement"))
|
||||
self.load_app.setToolTip(_translate("MainWindow", "Load the Semesterapparate from the database"))
|
||||
MainWindow.setWindowTitle(
|
||||
_translate("MainWindow", "Semesterapparatsmanagement")
|
||||
)
|
||||
self.load_app.setToolTip(
|
||||
_translate("MainWindow", "Load the Semesterapparate from the database")
|
||||
)
|
||||
self.load_app.setText(_translate("MainWindow", "App. aufrufen"))
|
||||
self.create_new_app.setText(_translate("MainWindow", "neu. App anlegen"))
|
||||
self.cancel_active_selection.setText(_translate("MainWindow", "Auswahl abbrechen"))
|
||||
self.cancel_active_selection.setText(
|
||||
_translate("MainWindow", "Auswahl abbrechen")
|
||||
)
|
||||
self.tableWidget_apparate.setSortingEnabled(True)
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "AppNr"))
|
||||
@@ -995,9 +1140,15 @@ class Ui_MainWindow(object):
|
||||
self._mand.setText(_translate("MainWindow", "*"))
|
||||
self.btn_add_document.setText(_translate("MainWindow", "Dokument hinzufügen"))
|
||||
self.btn_open_document.setText(_translate("MainWindow", "Dokument öffnen"))
|
||||
self.check_file.setToolTip(_translate("MainWindow", "Abhängig von der Anzahl der Medien kann die Suche sehr lange dauern"))
|
||||
self.check_file.setText(_translate("MainWindow", "Medien aus Dokument\n"
|
||||
" hinzufügen"))
|
||||
self.check_file.setToolTip(
|
||||
_translate(
|
||||
"MainWindow",
|
||||
"Abhängig von der Anzahl der Medien kann die Suche sehr lange dauern",
|
||||
)
|
||||
)
|
||||
self.check_file.setText(
|
||||
_translate("MainWindow", "Medien aus Dokument\n" " hinzufügen")
|
||||
)
|
||||
self.label_12.setText(_translate("MainWindow", "Prof-ID-aDIS"))
|
||||
self.label_13.setText(_translate("MainWindow", "Apparat-ID-aDIS"))
|
||||
self.check_send_mail.setText(_translate("MainWindow", "Mail senden"))
|
||||
@@ -1017,12 +1168,16 @@ class Ui_MainWindow(object):
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(6)
|
||||
item.setText(_translate("MainWindow", "Link"))
|
||||
self.label.setText(_translate("MainWindow", " Medienliste"))
|
||||
self.chkbx_show_del_media.setText(_translate("MainWindow", "gel. Medien anzeigen"))
|
||||
self.chkbx_show_del_media.setText(
|
||||
_translate("MainWindow", "gel. Medien anzeigen")
|
||||
)
|
||||
self.label_info.setText(_translate("MainWindow", "Medien werden hinzugefügt"))
|
||||
self.progress_label.setText(_translate("MainWindow", "Medium x/y"))
|
||||
self.btn_reserve.setText(_translate("MainWindow", "Vorgemertk?"))
|
||||
self.add_medium.setText(_translate("MainWindow", "Medien hinzufügen"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Anlegen"))
|
||||
self.tabWidget.setTabText(
|
||||
self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Anlegen")
|
||||
)
|
||||
self.btn_search.setText(_translate("MainWindow", "Suchen"))
|
||||
self.label_7.setText(_translate("MainWindow", "Appnr.:"))
|
||||
self.label_18.setText(_translate("MainWindow", "Dauerapp:"))
|
||||
@@ -1031,17 +1186,28 @@ class Ui_MainWindow(object):
|
||||
self.label_11.setText(_translate("MainWindow", "Person:"))
|
||||
self.label_16.setText(_translate("MainWindow", "Fach:"))
|
||||
self.label_15.setText(_translate("MainWindow", "Löschbar"))
|
||||
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_3), _translate("MainWindow", "Statistik"))
|
||||
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_4), _translate("MainWindow", "Suchen"))
|
||||
self.tabWidget_2.setTabText(
|
||||
self.tabWidget_2.indexOf(self.tab_3), _translate("MainWindow", "Statistik")
|
||||
)
|
||||
self.tabWidget_2.setTabText(
|
||||
self.tabWidget_2.indexOf(self.tab_4), _translate("MainWindow", "Suchen")
|
||||
)
|
||||
item = self.statistics_table.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "Semester"))
|
||||
item = self.statistics_table.horizontalHeaderItem(1)
|
||||
item.setText(_translate("MainWindow", "Zugang"))
|
||||
item = self.statistics_table.horizontalHeaderItem(2)
|
||||
item.setText(_translate("MainWindow", "Abgang"))
|
||||
self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_6), _translate("MainWindow", "Tabelle"))
|
||||
self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_7), _translate("MainWindow", "Erstellte und gelöschte Semesterapparate"))
|
||||
self.btn_del_select_apparats.setText(_translate("MainWindow", "Ausgewählte Löschen"))
|
||||
self.tabWidget_3.setTabText(
|
||||
self.tabWidget_3.indexOf(self.tab_6), _translate("MainWindow", "Tabelle")
|
||||
)
|
||||
self.tabWidget_3.setTabText(
|
||||
self.tabWidget_3.indexOf(self.tab_7),
|
||||
_translate("MainWindow", "Erstellte und gelöschte Semesterapparate"),
|
||||
)
|
||||
self.btn_del_select_apparats.setText(
|
||||
_translate("MainWindow", "Ausgewählte Löschen")
|
||||
)
|
||||
item = self.tableWidget.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", " "))
|
||||
item = self.tableWidget.horizontalHeaderItem(1)
|
||||
@@ -1052,17 +1218,31 @@ class Ui_MainWindow(object):
|
||||
item.setText(_translate("MainWindow", "Person"))
|
||||
item = self.tableWidget.horizontalHeaderItem(4)
|
||||
item.setText(_translate("MainWindow", "Fach"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Suchen / Statistik"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), _translate("MainWindow", "Admin"))
|
||||
self.tabWidget.setTabText(
|
||||
self.tabWidget.indexOf(self.tab_2),
|
||||
_translate("MainWindow", "Suchen / Statistik"),
|
||||
)
|
||||
self.tabWidget.setTabText(
|
||||
self.tabWidget.indexOf(self.tab_5), _translate("MainWindow", "Admin")
|
||||
)
|
||||
self.groupBox_2.setTitle(_translate("MainWindow", "Software"))
|
||||
self.appdata_check.setText(_translate("MainWindow", "Apparatsdaten eingegeben"))
|
||||
self.media_check.setText(_translate("MainWindow", "Medien hinzugefügt / importiert"))
|
||||
self.ids_check.setText(_translate("MainWindow", "Prof-ID und Apparat-ID eingetragen"))
|
||||
self.media_check.setText(
|
||||
_translate("MainWindow", "Medien hinzugefügt / importiert")
|
||||
)
|
||||
self.ids_check.setText(
|
||||
_translate("MainWindow", "Prof-ID und Apparat-ID eingetragen")
|
||||
)
|
||||
self.groupBox.setTitle(_translate("MainWindow", "aDIS"))
|
||||
self.media_checked.setText(_translate("MainWindow", "Medien geprüft"))
|
||||
self.media_edited_check.setText(_translate("MainWindow", "Medien bearbeitet"))
|
||||
self.app_created.setText(_translate("MainWindow", "Apparat angelegt"))
|
||||
self.btn_copy_adis_command.setToolTip(_translate("MainWindow", "Hier klicken, um die aDIS Abfrage in die Zwischenablage zu kopieren"))
|
||||
self.btn_copy_adis_command.setToolTip(
|
||||
_translate(
|
||||
"MainWindow",
|
||||
"Hier klicken, um die aDIS Abfrage in die Zwischenablage zu kopieren",
|
||||
)
|
||||
)
|
||||
self.btn_copy_adis_command.setText(_translate("MainWindow", " aDIS Abfrage"))
|
||||
self.label_14.setText(_translate("MainWindow", "Apparat"))
|
||||
self.btn_delete_message.setText(_translate("MainWindow", "Löschen"))
|
||||
|
||||
@@ -1,692 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1280</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1271</width>
|
||||
<height>671</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1261</width>
|
||||
<height>161</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="load_app">
|
||||
<property name="toolTip">
|
||||
<string>Load the Semesterapparate from the database</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>App. aufrufen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="create_new_app">
|
||||
<property name="text">
|
||||
<string>neu. App anlegen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QTableWidget" name="tableWidget_apparate">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>AppNr</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>App Name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Professor</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Dauerapparat</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="Line" name="line">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>160</y>
|
||||
<width>1261</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="gridLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>180</y>
|
||||
<width>1261</width>
|
||||
<height>461</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="0">
|
||||
<widget class="QTableWidget" name="tableWidget_apparat_media">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Buchtitel</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Autor</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Auflage</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Signatur</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="app_group_box">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Apparatsdetails</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QTableWidget" name="dokument_list">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>820</x>
|
||||
<y>20</y>
|
||||
<width>256</width>
|
||||
<height>192</height>
|
||||
</rect>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Dokumentname</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Typ</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>731</width>
|
||||
<height>151</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QComboBox" name="drpdwn_prof_title">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>50</y>
|
||||
<width>69</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>20</y>
|
||||
<width>91</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Apparatsname</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>80</y>
|
||||
<width>121</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Nachname, Vorname</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="sem_winter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>340</x>
|
||||
<y>50</y>
|
||||
<width>82</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Winter</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>71</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Prof. Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="drpdwn_app_nr">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>20</y>
|
||||
<width>69</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="app_name">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>340</x>
|
||||
<y>20</y>
|
||||
<width>113</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="sem_sommer">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>340</x>
|
||||
<y>70</y>
|
||||
<width>82</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sommer</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>61</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Prof. Titel</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>60</y>
|
||||
<width>51</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Semester</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="sem_year">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>410</x>
|
||||
<y>60</y>
|
||||
<width>113</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>2023</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>101</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Apparatsnummer</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btn_apparat_save">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<y>120</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Speichern</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btn_apparat_apply">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>350</x>
|
||||
<y>120</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Aktualisieren</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>340</x>
|
||||
<y>90</y>
|
||||
<width>101</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dauerapparat</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btn_add_document">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1100</x>
|
||||
<y>40</y>
|
||||
<width>131</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dokument hinzufügen</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btn_open_document">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1100</x>
|
||||
<y>80</y>
|
||||
<width>131</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dokument öffnen</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1110</x>
|
||||
<y>110</y>
|
||||
<width>25</width>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>200</y>
|
||||
<width>47</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Suche</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>80</x>
|
||||
<y>200</y>
|
||||
<width>211</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Buch oder Signatur</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>180</y>
|
||||
<width>1259</width>
|
||||
<height>18</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Medienliste</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Tab 2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1280</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuDatei">
|
||||
<property name="title">
|
||||
<string>Datei</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuEinstellungen">
|
||||
<property name="title">
|
||||
<string>Einstellungen</string>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="menuDatei"/>
|
||||
<addaction name="menuEinstellungen"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,477 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
# Form generated from reading UI file 'untitled.ui'
|
||||
##
|
||||
# Created by: Qt User Interface Compiler version 6.5.2
|
||||
##
|
||||
# WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PyQt6.QtCore import (
|
||||
QCoreApplication,
|
||||
QDate,
|
||||
QDateTime,
|
||||
QLocale,
|
||||
QMetaObject,
|
||||
QObject,
|
||||
QPoint,
|
||||
QRect,
|
||||
QSize,
|
||||
Qt,
|
||||
QTime,
|
||||
QUrl,
|
||||
)
|
||||
from PyQt6.QtGui import (
|
||||
QBrush,
|
||||
QColor,
|
||||
QConicalGradient,
|
||||
QCursor,
|
||||
QFont,
|
||||
QFontDatabase,
|
||||
QGradient,
|
||||
QIcon,
|
||||
QImage,
|
||||
QKeySequence,
|
||||
QLinearGradient,
|
||||
QPainter,
|
||||
QPalette,
|
||||
QPixmap,
|
||||
QRadialGradient,
|
||||
QTransform,
|
||||
QWidgetAction,
|
||||
)
|
||||
from PyQt6.QtWidgets import (
|
||||
QApplication,
|
||||
QCheckBox,
|
||||
QComboBox,
|
||||
QFormLayout,
|
||||
QFrame,
|
||||
QGridLayout,
|
||||
QGroupBox,
|
||||
QHBoxLayout,
|
||||
QHeaderView,
|
||||
QLabel,
|
||||
QLineEdit,
|
||||
QMainWindow,
|
||||
QMenu,
|
||||
QMenuBar,
|
||||
QPushButton,
|
||||
QRadioButton,
|
||||
QSizePolicy,
|
||||
QSpacerItem,
|
||||
QStatusBar,
|
||||
QTableWidget,
|
||||
QTableWidgetItem,
|
||||
QTabWidget,
|
||||
QToolButton,
|
||||
QVBoxLayout,
|
||||
QWidget,
|
||||
)
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
if not MainWindow.objectName():
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(1280, 720)
|
||||
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
|
||||
MainWindow.setSizePolicy(sizePolicy)
|
||||
self.centralwidget = QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
||||
sizePolicy1.setHorizontalStretch(0)
|
||||
sizePolicy1.setVerticalStretch(0)
|
||||
sizePolicy1.setHeightForWidth(
|
||||
self.centralwidget.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.centralwidget.setSizePolicy(sizePolicy1)
|
||||
self.verticalLayoutWidget = QWidget(self.centralwidget)
|
||||
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
|
||||
self.verticalLayoutWidget.setGeometry(QRect(0, 0, 1271, 671))
|
||||
self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.gridLayout = QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.tabWidget = QTabWidget(self.verticalLayoutWidget)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QWidget()
|
||||
self.tab.setObjectName("tab")
|
||||
sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
|
||||
sizePolicy2.setHorizontalStretch(0)
|
||||
sizePolicy2.setVerticalStretch(0)
|
||||
sizePolicy2.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth())
|
||||
self.tab.setSizePolicy(sizePolicy2)
|
||||
self.horizontalLayoutWidget_2 = QWidget(self.tab)
|
||||
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
|
||||
self.horizontalLayoutWidget_2.setGeometry(QRect(0, 0, 1261, 161))
|
||||
self.horizontalLayout_2 = QHBoxLayout(self.horizontalLayoutWidget_2)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.formLayout = QFormLayout()
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.verticalLayout_2 = QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.verticalSpacer = QSpacerItem(
|
||||
20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding
|
||||
)
|
||||
|
||||
self.verticalLayout_2.addItem(self.verticalSpacer)
|
||||
|
||||
self.load_app = QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.load_app.setObjectName("load_app")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.load_app)
|
||||
|
||||
self.create_new_app = QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.create_new_app.setObjectName("create_new_app")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.create_new_app)
|
||||
|
||||
self.verticalSpacer_2 = QSpacerItem(
|
||||
20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding
|
||||
)
|
||||
|
||||
self.verticalLayout_2.addItem(self.verticalSpacer_2)
|
||||
|
||||
self.formLayout.setLayout(0, QFormLayout.LabelRole, self.verticalLayout_2)
|
||||
|
||||
self.tableWidget_apparate = QTableWidget(self.horizontalLayoutWidget_2)
|
||||
if self.tableWidget_apparate.columnCount() < 4:
|
||||
self.tableWidget_apparate.setColumnCount(4)
|
||||
__qtablewidgetitem = QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(0, __qtablewidgetitem)
|
||||
__qtablewidgetitem1 = QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(1, __qtablewidgetitem1)
|
||||
__qtablewidgetitem2 = QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(2, __qtablewidgetitem2)
|
||||
__qtablewidgetitem3 = QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(3, __qtablewidgetitem3)
|
||||
self.tableWidget_apparate.setObjectName("tableWidget_apparate")
|
||||
|
||||
self.formLayout.setWidget(0, QFormLayout.FieldRole, self.tableWidget_apparate)
|
||||
|
||||
self.horizontalLayout_3 = QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
|
||||
self.formLayout.setLayout(2, QFormLayout.LabelRole, self.horizontalLayout_3)
|
||||
|
||||
self.horizontalLayout_4 = QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
|
||||
self.formLayout.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_4)
|
||||
|
||||
self.horizontalLayout_2.addLayout(self.formLayout)
|
||||
|
||||
self.line = QFrame(self.tab)
|
||||
self.line.setObjectName("line")
|
||||
self.line.setGeometry(QRect(0, 160, 1261, 21))
|
||||
self.line.setFrameShape(QFrame.HLine)
|
||||
self.line.setFrameShadow(QFrame.Sunken)
|
||||
self.gridLayoutWidget_2 = QWidget(self.tab)
|
||||
self.gridLayoutWidget_2.setObjectName("gridLayoutWidget_2")
|
||||
self.gridLayoutWidget_2.setGeometry(QRect(0, 180, 1261, 461))
|
||||
self.gridLayout_2 = QGridLayout(self.gridLayoutWidget_2)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.tableWidget_apparat_media = QTableWidget(self.gridLayoutWidget_2)
|
||||
if self.tableWidget_apparat_media.columnCount() < 4:
|
||||
self.tableWidget_apparat_media.setColumnCount(4)
|
||||
__qtablewidgetitem4 = QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(0, __qtablewidgetitem4)
|
||||
__qtablewidgetitem5 = QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(1, __qtablewidgetitem5)
|
||||
__qtablewidgetitem6 = QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(2, __qtablewidgetitem6)
|
||||
__qtablewidgetitem7 = QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(3, __qtablewidgetitem7)
|
||||
self.tableWidget_apparat_media.setObjectName("tableWidget_apparat_media")
|
||||
|
||||
self.gridLayout_2.addWidget(self.tableWidget_apparat_media, 2, 0, 1, 1)
|
||||
|
||||
self.app_group_box = QGroupBox(self.gridLayoutWidget_2)
|
||||
self.app_group_box.setObjectName("app_group_box")
|
||||
sizePolicy3 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
|
||||
sizePolicy3.setHorizontalStretch(0)
|
||||
sizePolicy3.setVerticalStretch(0)
|
||||
sizePolicy3.setHeightForWidth(
|
||||
self.app_group_box.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
self.app_group_box.setSizePolicy(sizePolicy3)
|
||||
font = QFont()
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
self.app_group_box.setFont(font)
|
||||
self.app_group_box.setAlignment(
|
||||
Qt.AlignLeading | Qt.AlignLeft | Qt.AlignVCenter
|
||||
)
|
||||
self.app_group_box.setCheckable(False)
|
||||
self.dokument_list = QTableWidget(self.app_group_box)
|
||||
if self.dokument_list.columnCount() < 2:
|
||||
self.dokument_list.setColumnCount(2)
|
||||
__qtablewidgetitem8 = QTableWidgetItem()
|
||||
self.dokument_list.setHorizontalHeaderItem(0, __qtablewidgetitem8)
|
||||
__qtablewidgetitem9 = QTableWidgetItem()
|
||||
self.dokument_list.setHorizontalHeaderItem(1, __qtablewidgetitem9)
|
||||
self.dokument_list.setObjectName("dokument_list")
|
||||
self.dokument_list.setGeometry(QRect(820, 20, 256, 192))
|
||||
self.frame = QFrame(self.app_group_box)
|
||||
self.frame.setObjectName("frame")
|
||||
self.frame.setGeometry(QRect(10, 30, 731, 151))
|
||||
sizePolicy1.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
|
||||
self.frame.setSizePolicy(sizePolicy1)
|
||||
self.frame.setFrameShape(QFrame.StyledPanel)
|
||||
self.frame.setFrameShadow(QFrame.Raised)
|
||||
self.drpdwn_prof_title = QComboBox(self.frame)
|
||||
self.drpdwn_prof_title.setObjectName("drpdwn_prof_title")
|
||||
self.drpdwn_prof_title.setGeometry(QRect(110, 50, 69, 22))
|
||||
self.label_5 = QLabel(self.frame)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.label_5.setGeometry(QRect(250, 20, 91, 21))
|
||||
font1 = QFont()
|
||||
font1.setPointSize(9)
|
||||
font1.setBold(False)
|
||||
self.label_5.setFont(font1)
|
||||
self.lineEdit = QLineEdit(self.frame)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.lineEdit.setGeometry(QRect(110, 80, 121, 20))
|
||||
self.lineEdit.setFont(font1)
|
||||
self.sem_winter = QRadioButton(self.frame)
|
||||
self.sem_winter.setObjectName("sem_winter")
|
||||
self.sem_winter.setGeometry(QRect(340, 50, 82, 17))
|
||||
self.sem_winter.setFont(font1)
|
||||
self.label_4 = QLabel(self.frame)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.label_4.setGeometry(QRect(10, 80, 71, 21))
|
||||
self.label_4.setFont(font1)
|
||||
self.drpdwn_app_nr = QComboBox(self.frame)
|
||||
self.drpdwn_app_nr.setObjectName("drpdwn_app_nr")
|
||||
self.drpdwn_app_nr.setGeometry(QRect(110, 20, 69, 22))
|
||||
self.app_name = QLineEdit(self.frame)
|
||||
self.app_name.setObjectName("app_name")
|
||||
self.app_name.setGeometry(QRect(340, 20, 113, 20))
|
||||
self.sem_sommer = QRadioButton(self.frame)
|
||||
self.sem_sommer.setObjectName("sem_sommer")
|
||||
self.sem_sommer.setGeometry(QRect(340, 70, 82, 17))
|
||||
self.sem_sommer.setFont(font1)
|
||||
self.label_3 = QLabel(self.frame)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.label_3.setGeometry(QRect(10, 50, 61, 20))
|
||||
self.label_3.setFont(font1)
|
||||
self.label_6 = QLabel(self.frame)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.label_6.setGeometry(QRect(270, 60, 51, 21))
|
||||
self.label_6.setFont(font1)
|
||||
self.sem_year = QLineEdit(self.frame)
|
||||
self.sem_year.setObjectName("sem_year")
|
||||
self.sem_year.setGeometry(QRect(410, 60, 113, 20))
|
||||
self.sem_year.setFont(font1)
|
||||
self.label_2 = QLabel(self.frame)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.label_2.setGeometry(QRect(10, 20, 101, 21))
|
||||
self.label_2.setFont(font1)
|
||||
self.btn_apparat_save = QPushButton(self.frame)
|
||||
self.btn_apparat_save.setObjectName("btn_apparat_save")
|
||||
self.btn_apparat_save.setGeometry(QRect(260, 120, 75, 23))
|
||||
self.btn_apparat_save.setFont(font1)
|
||||
self.btn_apparat_apply = QPushButton(self.frame)
|
||||
self.btn_apparat_apply.setObjectName("btn_apparat_apply")
|
||||
self.btn_apparat_apply.setGeometry(QRect(350, 120, 75, 23))
|
||||
self.btn_apparat_apply.setFont(font1)
|
||||
self.checkBox = QCheckBox(self.frame)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.checkBox.setGeometry(QRect(340, 90, 101, 17))
|
||||
self.checkBox.setFont(font1)
|
||||
self.btn_add_document = QPushButton(self.app_group_box)
|
||||
self.btn_add_document.setObjectName("btn_add_document")
|
||||
self.btn_add_document.setGeometry(QRect(1100, 40, 131, 25))
|
||||
self.btn_add_document.setFont(font1)
|
||||
self.btn_open_document = QPushButton(self.app_group_box)
|
||||
self.btn_open_document.setObjectName("btn_open_document")
|
||||
self.btn_open_document.setGeometry(QRect(1100, 80, 131, 25))
|
||||
self.btn_open_document.setFont(font1)
|
||||
self.toolButton = QToolButton(self.app_group_box)
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.toolButton.setGeometry(QRect(1110, 110, 25, 19))
|
||||
self.label_7 = QLabel(self.app_group_box)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.label_7.setGeometry(QRect(20, 200, 47, 21))
|
||||
self.label_7.setFont(font1)
|
||||
self.lineEdit_2 = QLineEdit(self.app_group_box)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
self.lineEdit_2.setGeometry(QRect(80, 200, 211, 20))
|
||||
self.lineEdit_2.setFont(font1)
|
||||
self.label = QLabel(self.app_group_box)
|
||||
self.label.setObjectName("label")
|
||||
self.label.setGeometry(QRect(0, 180, 1259, 18))
|
||||
font2 = QFont()
|
||||
font2.setPointSize(11)
|
||||
font2.setBold(True)
|
||||
self.label.setFont(font2)
|
||||
|
||||
self.gridLayout_2.addWidget(self.app_group_box, 1, 0, 1, 1)
|
||||
|
||||
self.tabWidget.addTab(self.tab, "")
|
||||
self.tab_2 = QWidget()
|
||||
self.tab_2.setObjectName("tab_2")
|
||||
self.tabWidget.addTab(self.tab_2, "")
|
||||
|
||||
self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
|
||||
|
||||
self.horizontalLayout.addLayout(self.gridLayout)
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QMenuBar(MainWindow)
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menubar.setGeometry(QRect(0, 0, 1280, 21))
|
||||
self.menuDatei = QMenu(self.menubar)
|
||||
self.menuDatei.setObjectName("menuDatei")
|
||||
self.menuEinstellungen = QMenu(self.menubar)
|
||||
self.menuEinstellungen.setObjectName("menuEinstellungen")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
|
||||
self.menubar.addAction(self.menuDatei.menuAction())
|
||||
self.menubar.addAction(self.menuEinstellungen.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
|
||||
QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
MainWindow.setWindowTitle(
|
||||
QCoreApplication.translate("MainWindow", "MainWindow", None)
|
||||
)
|
||||
# if QT_CONFIG(tooltip)
|
||||
self.load_app.setToolTip(
|
||||
QCoreApplication.translate(
|
||||
"MainWindow", "Load the Semesterapparate from the database", None
|
||||
)
|
||||
)
|
||||
# endif // QT_CONFIG(tooltip)
|
||||
self.load_app.setText(
|
||||
QCoreApplication.translate("MainWindow", "App. aufrufen", None)
|
||||
)
|
||||
self.create_new_app.setText(
|
||||
QCoreApplication.translate("MainWindow", "neu. App anlegen", None)
|
||||
)
|
||||
___qtablewidgetitem = self.tableWidget_apparate.horizontalHeaderItem(0)
|
||||
___qtablewidgetitem.setText(
|
||||
QCoreApplication.translate("MainWindow", "AppNr", None)
|
||||
)
|
||||
___qtablewidgetitem1 = self.tableWidget_apparate.horizontalHeaderItem(1)
|
||||
___qtablewidgetitem1.setText(
|
||||
QCoreApplication.translate("MainWindow", "App Name", None)
|
||||
)
|
||||
___qtablewidgetitem2 = self.tableWidget_apparate.horizontalHeaderItem(2)
|
||||
___qtablewidgetitem2.setText(
|
||||
QCoreApplication.translate("MainWindow", "Professor", None)
|
||||
)
|
||||
___qtablewidgetitem3 = self.tableWidget_apparate.horizontalHeaderItem(3)
|
||||
___qtablewidgetitem3.setText(
|
||||
QCoreApplication.translate("MainWindow", "Dauerapparat", None)
|
||||
)
|
||||
___qtablewidgetitem4 = self.tableWidget_apparat_media.horizontalHeaderItem(0)
|
||||
___qtablewidgetitem4.setText(
|
||||
QCoreApplication.translate("MainWindow", "Buchtitel", None)
|
||||
)
|
||||
___qtablewidgetitem5 = self.tableWidget_apparat_media.horizontalHeaderItem(1)
|
||||
___qtablewidgetitem5.setText(
|
||||
QCoreApplication.translate("MainWindow", "Autor", None)
|
||||
)
|
||||
___qtablewidgetitem6 = self.tableWidget_apparat_media.horizontalHeaderItem(2)
|
||||
___qtablewidgetitem6.setText(
|
||||
QCoreApplication.translate("MainWindow", "Auflage", None)
|
||||
)
|
||||
___qtablewidgetitem7 = self.tableWidget_apparat_media.horizontalHeaderItem(3)
|
||||
___qtablewidgetitem7.setText(
|
||||
QCoreApplication.translate("MainWindow", "Signatur", None)
|
||||
)
|
||||
self.app_group_box.setTitle(
|
||||
QCoreApplication.translate("MainWindow", "Apparatsdetails", None)
|
||||
)
|
||||
___qtablewidgetitem8 = self.dokument_list.horizontalHeaderItem(0)
|
||||
___qtablewidgetitem8.setText(
|
||||
QCoreApplication.translate("MainWindow", "Dokumentname", None)
|
||||
)
|
||||
___qtablewidgetitem9 = self.dokument_list.horizontalHeaderItem(1)
|
||||
___qtablewidgetitem9.setText(
|
||||
QCoreApplication.translate("MainWindow", "Typ", None)
|
||||
)
|
||||
self.label_5.setText(
|
||||
QCoreApplication.translate("MainWindow", "Apparatsname", None)
|
||||
)
|
||||
self.lineEdit.setPlaceholderText(
|
||||
QCoreApplication.translate("MainWindow", "Nachname, Vorname", None)
|
||||
)
|
||||
self.sem_winter.setText(
|
||||
QCoreApplication.translate("MainWindow", "Winter", None)
|
||||
)
|
||||
self.label_4.setText(
|
||||
QCoreApplication.translate("MainWindow", "Prof. Name", None)
|
||||
)
|
||||
self.sem_sommer.setText(
|
||||
QCoreApplication.translate("MainWindow", "Sommer", None)
|
||||
)
|
||||
self.label_3.setText(
|
||||
QCoreApplication.translate("MainWindow", "Prof. Titel", None)
|
||||
)
|
||||
self.label_6.setText(QCoreApplication.translate("MainWindow", "Semester", None))
|
||||
self.sem_year.setPlaceholderText(
|
||||
QCoreApplication.translate("MainWindow", "2023", None)
|
||||
)
|
||||
self.label_2.setText(
|
||||
QCoreApplication.translate("MainWindow", "Apparatsnummer", None)
|
||||
)
|
||||
self.btn_apparat_save.setText(
|
||||
QCoreApplication.translate("MainWindow", "Speichern", None)
|
||||
)
|
||||
self.btn_apparat_apply.setText(
|
||||
QCoreApplication.translate("MainWindow", "Aktualisieren", None)
|
||||
)
|
||||
self.checkBox.setText(
|
||||
QCoreApplication.translate("MainWindow", "Dauerapparat", None)
|
||||
)
|
||||
self.btn_add_document.setText(
|
||||
QCoreApplication.translate("MainWindow", "Dokument hinzuf\u00fcgen", None)
|
||||
)
|
||||
self.btn_open_document.setText(
|
||||
QCoreApplication.translate("MainWindow", "Dokument \u00f6ffnen", None)
|
||||
)
|
||||
self.toolButton.setText(QCoreApplication.translate("MainWindow", "...", None))
|
||||
self.label_7.setText(QCoreApplication.translate("MainWindow", "Suche", None))
|
||||
self.lineEdit_2.setPlaceholderText(
|
||||
QCoreApplication.translate("MainWindow", "Buch oder Signatur", None)
|
||||
)
|
||||
self.label.setText(
|
||||
QCoreApplication.translate("MainWindow", "Medienliste", None)
|
||||
)
|
||||
self.tabWidget.setTabText(
|
||||
self.tabWidget.indexOf(self.tab),
|
||||
QCoreApplication.translate("MainWindow", "Tab 1", None),
|
||||
)
|
||||
self.tabWidget.setTabText(
|
||||
self.tabWidget.indexOf(self.tab_2),
|
||||
QCoreApplication.translate("MainWindow", "Tab 2", None),
|
||||
)
|
||||
self.menuDatei.setTitle(QCoreApplication.translate("MainWindow", "Datei", None))
|
||||
self.menuEinstellungen.setTitle(
|
||||
QCoreApplication.translate("MainWindow", "Einstellungen", None)
|
||||
)
|
||||
|
||||
# retranslateUi
|
||||
|
||||
@@ -63,7 +63,7 @@ class Ui_Form(object):
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
font.setBold(True)
|
||||
font.setItal#ic(False)
|
||||
font.setItal # ic(False)
|
||||
font.setUnderline(False)
|
||||
font.setWeight(75)
|
||||
font.setKerning(True)
|
||||
|
||||
@@ -55,7 +55,7 @@ class StatusWidget(QWidget):
|
||||
action_item, [f"{person} ({str(len(entries))})"]
|
||||
)
|
||||
for entry in entries:
|
||||
entry_item = QTreeWidgetItem(person_item, [entry])
|
||||
QTreeWidgetItem(person_item, [entry])
|
||||
# Make the person entry collapsible
|
||||
person_item.setExpanded(False)
|
||||
|
||||
@@ -75,4 +75,3 @@ if __name__ == "__main__":
|
||||
widget.person_double_clicked.connect(lambda x: print(x))
|
||||
|
||||
sys.exit(app.exec())
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class CollapsibleWidget(object):
|
||||
pass
|
||||
|
||||
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class CollapsibleWidget(object):
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class CollapsibleWidget(object):
|
||||
|
||||
@@ -49,4 +49,3 @@ if __name__ == "__main__":
|
||||
widget = GraphWidget(data=data, legend_labels=["+", "-"])
|
||||
widget.show()
|
||||
sys.exit(app.exec())
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
# Form implementation generated from reading ui file '/home/alexander/GitHub/SemesterapparatsManager/src/ui/widgets/webview.ui'
|
||||
#
|
||||
# Created by: PySide6 UI code generator 6.6.1
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PySide6 import QtWebEngineWidgets
|
||||
from PyQt6 import QtCore, QtGui, QtWebEngineWidgets, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
@@ -16,7 +15,9 @@ class Ui_MainWindow(object):
|
||||
MainWindow.resize(800, 600)
|
||||
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.webEngineView = QtWebEngineWidgets.QWebEngineView(parent=self.centralwidget)
|
||||
self.webEngineView = QtWebEngineWidgets.QWebEngineView(
|
||||
parent=self.centralwidget
|
||||
)
|
||||
self.webEngineView.setGeometry(QtCore.QRect(160, 190, 300, 200))
|
||||
self.webEngineView.setUrl(QtCore.QUrl("about:blank"))
|
||||
self.webEngineView.setObjectName("webEngineView")
|
||||
|
||||
30
src/utils/Ui_docs.py
Normal file
30
src/utils/Ui_docs.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\utils\docs.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.6.1
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(800, 600)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.tabs = QtWidgets.QTabWidget(parent=Dialog)
|
||||
self.tabs.setObjectName("tabs")
|
||||
self.gridLayout.addWidget(self.tabs, 0, 0, 1, 1)
|
||||
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
@@ -1,2 +1,2 @@
|
||||
from .pickles import load_pickle, dump_pickle
|
||||
from .blob import create_blob
|
||||
from .blob import create_blob
|
||||
from .pickles import dump_pickle, load_pickle
|
||||
|
||||
@@ -5,5 +5,3 @@ def create_blob(file):
|
||||
with open(file, "rb") as f:
|
||||
blob = f.read()
|
||||
return blob
|
||||
|
||||
|
||||
|
||||
28
src/utils/docs.ui
Normal file
28
src/utils/docs.ui
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabs"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
77
src/utils/docs_ui.py
Normal file
77
src/utils/docs_ui.py
Normal file
@@ -0,0 +1,77 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'docs.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PyQt6.QtCore import (
|
||||
QCoreApplication,
|
||||
QDate,
|
||||
QDateTime,
|
||||
QLocale,
|
||||
QMetaObject,
|
||||
QObject,
|
||||
QPoint,
|
||||
QRect,
|
||||
QSize,
|
||||
Qt,
|
||||
QTime,
|
||||
QUrl,
|
||||
)
|
||||
from PyQt6.QtGui import (
|
||||
QBrush,
|
||||
QColor,
|
||||
QConicalGradient,
|
||||
QCursor,
|
||||
QFont,
|
||||
QFontDatabase,
|
||||
QGradient,
|
||||
QIcon,
|
||||
QImage,
|
||||
QKeySequence,
|
||||
QLinearGradient,
|
||||
QPainter,
|
||||
QPalette,
|
||||
QPixmap,
|
||||
QRadialGradient,
|
||||
QTransform,
|
||||
)
|
||||
from PyQt6.QtWidgets import (
|
||||
QApplication,
|
||||
QDialog,
|
||||
QGridLayout,
|
||||
QSizePolicy,
|
||||
QTabWidget,
|
||||
QWidget,
|
||||
)
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dokumentation")
|
||||
Dialog.resize(800, 600)
|
||||
self.gridLayout_2 = QGridLayout(Dialog)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.gridLayout = QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.tabs = QTabWidget(Dialog)
|
||||
self.tabs.setObjectName("tabs")
|
||||
|
||||
self.gridLayout.addWidget(self.tabs, 0, 0, 1, 1)
|
||||
|
||||
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
|
||||
QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", "Dialog", None))
|
||||
|
||||
# retranslateUi
|
||||
@@ -1,9 +1,9 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# from PySide6 import Webview
|
||||
from PySide6.QtWebEngineWidgets import QWebEngineView
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QTabWidget
|
||||
# from PyQt6 import Webview
|
||||
from PyQt6.QtWebEngineWidgets import QWebEngineView
|
||||
from PyQt6.QtWidgets import QApplication, QMainWindow, QTabWidget
|
||||
|
||||
documentation_path = "docs"
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import pickle
|
||||
|
||||
|
||||
def load_pickle(data):
|
||||
return pickle.loads(data)
|
||||
|
||||
|
||||
def dump_pickle(data):
|
||||
return pickle.dumps(data)
|
||||
|
||||
149
test.py
149
test.py
@@ -1,142 +1,11 @@
|
||||
# # # # tupl = (0, 0, 0, 0, 0, 0)
|
||||
olddata = (
|
||||
None,
|
||||
"Christian",
|
||||
"Berger",
|
||||
"alexander.kirchner@ph-freiburg.de",
|
||||
"764",
|
||||
"Berger Christian",
|
||||
)
|
||||
|
||||
|
||||
# # # # def change_value(index: int, state: int):
|
||||
# # # # global tupl
|
||||
# # # # tupl = list(tupl)
|
||||
# # # # print(len(tupl))
|
||||
# # # # tupl[index] = state
|
||||
# # # # tupl = tuple(tupl)
|
||||
|
||||
|
||||
# # # # def check_validity() -> bool:
|
||||
# # # # global tupl
|
||||
# # # # if all(tupl):
|
||||
# # # # return True
|
||||
# # # # else:
|
||||
# # # # return False
|
||||
|
||||
|
||||
# # # # print(tupl)
|
||||
# # # # print(check_validity())
|
||||
# # # # change_value(0, 1)
|
||||
# # # # for i in range(1, 6):
|
||||
# # # # change_value(i, 1)
|
||||
# # # # print(tupl)
|
||||
# # # # print(check_validity())
|
||||
# # # import sqlite3
|
||||
# # # from codebase import Database
|
||||
# # # # print(messages)
|
||||
|
||||
# # # def day_to_message(messages:list[dict[str]]):
|
||||
# # # print(messages)
|
||||
# # # ret = []
|
||||
# # # #extract the remind_at from each message and add them to ret. If the key already exists, append the message to the list
|
||||
# # # for message in messages:
|
||||
# # # print(message)
|
||||
# # # remind_at = message["remind_at"]
|
||||
# # # if remind_at in ret:
|
||||
# # # ret[remind_at].append(message)
|
||||
# # # else:
|
||||
# # # ret[remind_at] = [message]
|
||||
# # # print(ret)
|
||||
# # # if __name__ =="__man__":
|
||||
# # # db = Database()
|
||||
|
||||
# # # messages = db.get_messages()
|
||||
# # # print(messages)
|
||||
# # # print(day_to_message(messages))
|
||||
|
||||
|
||||
# # from natsort import natsorted
|
||||
|
||||
# # unsorted = ["WiSe 23/24", "SoSe 23", "WiSe 21/22", "SoSe 21", "WiSe 22/23", "SoSe 22"]
|
||||
|
||||
# # def custom_sort(unsorted:list[str])->list[str]:
|
||||
# # """Sort a list of semesters in the format "SoSe n" and "WiSe n/n+1" in the correct order.
|
||||
# # Where n == year in 2 digit format
|
||||
|
||||
# # Args:
|
||||
# # unsorted (list[str]): List of semesters in the format "SoSe n" and "WiSe n/n+1"
|
||||
|
||||
# # Returns:
|
||||
# # ret (list[str]): Sorted list in correct order
|
||||
# # """
|
||||
# # #split the list into two lists, one with the summer semesters and one with the winter semesters
|
||||
# # summer = natsorted([ i for i in unsorted if "SoSe" in i])
|
||||
# # winter = natsorted([i for i in unsorted if "WiSe" in i])
|
||||
# # #merge the lists entries alternately
|
||||
# # ret = []
|
||||
# # for i in range(len(summer)):
|
||||
# # ret.append(summer[i])
|
||||
# # ret.append(winter[i])
|
||||
# # return ret
|
||||
# from typing import Any
|
||||
|
||||
# def statistic_request(**kwargs:Any):
|
||||
|
||||
|
||||
# if "deletable" in kwargs.keys():
|
||||
# query = f"SELECT * FROM semesterapparat WHERE deletion_status=0 AND dauer=0 AND (erstellsemester!='{kwargs['deletesemester']}' OR verlängerung_bis!='{kwargs['deletesemester']}')"
|
||||
# return query
|
||||
|
||||
# if "dauer" in kwargs.keys():
|
||||
# kwargs["dauer"] = kwargs["dauer"].replace("Ja", "1").replace("Nein", "0")
|
||||
# query = "SELECT * FROM semesterapparat WHERE "
|
||||
# for key, value in kwargs.items() if kwargs.items() is not None else {}:
|
||||
# print(key, value)
|
||||
# query += f"{key}='{value}' AND "
|
||||
# print(query)
|
||||
# #remove deletesemester part from normal query, as this will be added to the database upon deleting the apparat
|
||||
# if "deletesemester" in kwargs.keys():
|
||||
# query = query.replace(f"deletesemester='{kwargs['deletesemester']}' AND ", "")
|
||||
# if "endsemester" in kwargs.keys():
|
||||
# if "erstellsemester" in kwargs.keys():
|
||||
# query = query.replace(f"endsemester='{kwargs['endsemester']}' AND ", "")
|
||||
# query = query.replace(f"erstellsemester='{kwargs['erstellsemester']} AND ", "xyz")
|
||||
# else:
|
||||
# query = query.replace(f"endsemester='{kwargs['endsemester']}' AND ", "xyz")
|
||||
# print("replaced")
|
||||
# query = query.replace("xyz", f"(erstellsemester='{kwargs['endsemester']}' OR verlängerung_bis='{kwargs['endsemester']}') AND ")
|
||||
|
||||
# query = query[:-5].strip()
|
||||
# return query
|
||||
# from threads import AutoAdder
|
||||
# from PyQt6 import QtWidgets
|
||||
# from ui import parsed_titles_ui
|
||||
# import sys
|
||||
# def main(data):
|
||||
# app = QtWidgets.QApplication(sys.argv)
|
||||
# dialog = QtWidgets.QDialog()
|
||||
# ui = parsed_titles_ui()
|
||||
# ui.setupUi(dialog)
|
||||
# ui.signatures = data
|
||||
# ui.app_id = 3
|
||||
# ui.prof_id = 1
|
||||
# ui.toolButton.click()
|
||||
# ui.populate_table()
|
||||
# ui.progressBar.setMaximum(len(data))
|
||||
# ui.progressBar.setValue(0)
|
||||
|
||||
# dialog.show()
|
||||
# sys.exit(app.exec())
|
||||
|
||||
# if __name__ == "__main__":
|
||||
# data = ['YH 6876 S344', 'YM 3500 L925', 'CU 3200 W862', 'CW 6940 W842', 'CZ 1360 M379', 'CU 3800 V445', 'CU 3100 L948', 'CU 3200 H379 (3)', 'YC 7093 K95', 'CU 8590 E34 (2)', 'MS 6410 L744 (2)+1', 'CUS778', 'Psy K 120: 125 b', 'Psy L 170: 66', 'MR 2600 M474 (12)+16', 'Psy K 760: 19', 'Psy K 110: 92', 'Psy K 400: 45 a', 'CD 20/10,6']
|
||||
# main(data)
|
||||
|
||||
# from src.backend.database import Database
|
||||
# import pickle
|
||||
# db = Database()
|
||||
|
||||
# query="SELECT * from media where id=1"
|
||||
# _data = db.database.execute(query).fetchall()
|
||||
# var = _data[0][1]
|
||||
# print(pickle.loads(var))
|
||||
from src.backend.database_rewrite import Database
|
||||
from omegaconf import OmegaConf
|
||||
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
subjects = [subject["name"] for subject in config.subjects]
|
||||
print(subjects)
|
||||
print(olddata[1], olddata[2], olddata[3], olddata[4], olddata[5])
|
||||
|
||||
66
test/bookgrabbertest.py
Normal file
66
test/bookgrabbertest.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from src.backend.database import Database
|
||||
from src.logic.webrequest import BibTextTransformer, WebRequest
|
||||
|
||||
|
||||
class BookGrabber:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
mode: str = None,
|
||||
data: list = None,
|
||||
app_id: int = None,
|
||||
prof_id: int = None,
|
||||
):
|
||||
self.app_id = app_id
|
||||
self.prof_id = prof_id
|
||||
self.mode = mode
|
||||
self.data = data
|
||||
self.book_id = None
|
||||
|
||||
def run(self):
|
||||
self.db = Database()
|
||||
item = 0
|
||||
for entry in self.data:
|
||||
signature = str(entry)
|
||||
self.logger.log_info("Processing entry: " + signature)
|
||||
|
||||
webdata = WebRequest().get_ppn(entry).get_data()
|
||||
if webdata == "error":
|
||||
continue
|
||||
bd = BibTextTransformer(self.mode).get_data(webdata).return_data()
|
||||
transformer = BibTextTransformer("RDS")
|
||||
rds = transformer.get_data(webdata).return_data("rds_availability")
|
||||
bd.signature = entry
|
||||
# confirm lock is acquired
|
||||
print("lock acquired, adding book to database")
|
||||
self.db.addBookToDatabase(bd, self.app_id, self.prof_id)
|
||||
# get latest book id
|
||||
self.book_id = self.db.getLastBookId()
|
||||
self.logger.log_info("Added book to database")
|
||||
state = 0
|
||||
for rds_item in rds.items:
|
||||
sign = rds_item.superlocation
|
||||
loc = rds_item.location
|
||||
# print(item.location)
|
||||
if self.app_id in sign or self.app_id in loc:
|
||||
state = 1
|
||||
book_id = None
|
||||
# for book in self.books:
|
||||
# if book["bookdata"].signature == entry:
|
||||
# book_id = book["id"]
|
||||
# break
|
||||
self.logger.log_info(f"State of {signature}: {state}")
|
||||
print(
|
||||
"lock acquired, updating availability of "
|
||||
+ str(book_id)
|
||||
+ " to "
|
||||
+ str(state)
|
||||
)
|
||||
try:
|
||||
self.db.setAvailability(self.book_id, state)
|
||||
except sqlite3.OperationalError as e:
|
||||
self.logger.log_error(f"Failed to update availability: {e}")
|
||||
break
|
||||
|
||||
# time.sleep(5)
|
||||
item += 1
|
||||
@@ -1,15 +1,17 @@
|
||||
from src.backend.database import Database
|
||||
import pytest
|
||||
|
||||
|
||||
from src.backend.database import Database
|
||||
|
||||
|
||||
def test_prof():
|
||||
assert Database().getProfNameById(1,add_title=True) == "Karoß Sabine"
|
||||
assert Database().getProfNameById(1,add_title=False) == "Karoß Sabine"
|
||||
assert Database().getProfNameById(1, add_title=True) == "Karoß Sabine"
|
||||
assert Database().getProfNameById(1, add_title=False) == "Karoß Sabine"
|
||||
assert Database().getProfId("Karoß Sabine") == 1
|
||||
|
||||
|
||||
|
||||
def test_apparat():
|
||||
assert Database().getApparatName(3,1) == "Theorie und Praxis Gymnastik"
|
||||
|
||||
assert Database().getApparatName(3, 1) == "Theorie und Praxis Gymnastik"
|
||||
|
||||
|
||||
def test_admin():
|
||||
assert len(Database().getUser()) >=1 and "admin" in Database().getUser()
|
||||
|
||||
|
||||
assert len(Database().getUser()) >= 1 and "admin" in Database().getUser()
|
||||
|
||||
@@ -7,4 +7,4 @@ def many_test_webdata():
|
||||
test_webdata_bibtexttransform("COinS")
|
||||
test_webdata_bibtexttransform("ARRAY")
|
||||
test_webdata_bibtexttransform("RDS")
|
||||
assert True is True
|
||||
assert True is True
|
||||
|
||||
103
test/rds_test.py
Normal file
103
test/rds_test.py
Normal file
@@ -0,0 +1,103 @@
|
||||
def contact_prof(self):
|
||||
dialog = QtWidgets.QDialog()
|
||||
mail_prev = Mail_Dialog()
|
||||
mail_prev.setupUi(dialog)
|
||||
mail_prevs = os.listdir("mail_vorlagen")
|
||||
if self.app_name.text() == "":
|
||||
mail_prevs.remove("Information zum Semesterapparat.eml")
|
||||
mail_prev.comboBox.addItems(mail_prevs)
|
||||
active_apparat_id = self.tableWidget_apparate.item(
|
||||
self.tableWidget_apparate.currentRow(), 0
|
||||
).text()
|
||||
general_data = {
|
||||
"Appname": self.app_name.text(),
|
||||
"AppSubject": self.app_fach.currentText(),
|
||||
"appnr": self.active_apparat,
|
||||
}
|
||||
print(active_apparat_id)
|
||||
mail_prev.appid = active_apparat_id
|
||||
base_data = self.db.getProfData(id=active_apparat_id)
|
||||
profname = self.db.getProfNameById(base_data["id"])
|
||||
profname = profname.split(" ")
|
||||
profname = f"{profname[1]} {profname[0]}"
|
||||
pass_data = {
|
||||
"prof_name": profname,
|
||||
"mail_name": base_data["prof_mail"],
|
||||
"general": general_data,
|
||||
}
|
||||
|
||||
mail_prev.set_data(pass_data)
|
||||
mail_prev.set_mail()
|
||||
dialog.exec()
|
||||
|
||||
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from src.ui.dialogs.mail_preview import Ui_Dialog
|
||||
|
||||
|
||||
class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.appid = ""
|
||||
self.mail_data = ""
|
||||
self.data = None
|
||||
self.buttonBox.accepted.connect(self.save_mail)
|
||||
|
||||
def set_data(self, data: dict):
|
||||
print(data)
|
||||
self.prof_name.setText(data["prof_name"])
|
||||
self.mail_name.setText(data["mail_name"])
|
||||
# assign data["general"] to self.data
|
||||
self.data = data["general"]
|
||||
|
||||
def set_mail(self):
|
||||
email_template = self.comboBox.currentText()
|
||||
with open(f"mail_vorlagen/{email_template}", "r", encoding="utf-8") as f:
|
||||
mail_template = f.read()
|
||||
email_header = email_template.split(".eml")[0]
|
||||
if "{AppNr}" in email_template:
|
||||
email_header = email_template.split(".eml")[0].format(AppNr=self.appid)
|
||||
self.mail_header.setText(email_header)
|
||||
self.mail_data = mail_template.split("<html>")[0]
|
||||
mail_html = mail_template.split("<html>")[1]
|
||||
mail_html = "<html>" + mail_html
|
||||
print(self.data)
|
||||
Appname = self.data["Appname"]
|
||||
mail_html = mail_html.format(
|
||||
Profname=self.prof_name.text().split(" ")[-1], Appname=Appname
|
||||
)
|
||||
|
||||
self.mail_body.setHtml(mail_html)
|
||||
|
||||
def save_mail(self):
|
||||
# create a temporary file
|
||||
mail_header = self.mail_header.text()
|
||||
mail_body = self.mail_body.toHtml()
|
||||
mail = self.mail_data + mail_body
|
||||
mail = mail.replace("Subject:", f"Subject: {mail_header}")
|
||||
with tempfile.NamedTemporaryFile(
|
||||
mode="w", delete=False, suffix=".eml", encoding="utf-8", dir="mails"
|
||||
) as f:
|
||||
f.write(mail)
|
||||
self.mail_path = f.name
|
||||
print(self.mail_path)
|
||||
# open the file using thunderbird
|
||||
subprocess.Popen(["thunderbird", f"{self.mail_path}"])
|
||||
# delete the file
|
||||
# os.remove(self.mail_path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
Dialog = QtWidgets.QDialog()
|
||||
ui = Mail_Dialog()
|
||||
ui.setupUi(Dialog)
|
||||
Dialog.show()
|
||||
sys.exit(app.exec())
|
||||
7
test/semestergen_test.py
Normal file
7
test/semestergen_test.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from src.backend.semester import generateSemesterByDate
|
||||
|
||||
|
||||
def test_generateSemesterByDate():
|
||||
assert generateSemesterByDate() == "WiSe 23/24"
|
||||
@@ -1,5 +1,4 @@
|
||||
from src.backend.database import Database
|
||||
|
||||
|
||||
db = Database("semap.db")
|
||||
# print(db.query_db("SELECT * FROM subjects WHERE id=1"))
|
||||
# print(db.query_db("SELECT * FROM subjects WHERE id=1"))
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
import pytest
|
||||
from src.logic.webrequest import WebRequest
|
||||
from src.logic.webrequest import BibTextTransformer
|
||||
from src.logic.dataclass import BookData
|
||||
|
||||
def test_webdata_bibtexttransform(source_data:str="RIS"):
|
||||
from src.logic.dataclass import BookData
|
||||
from src.logic.webrequest import BibTextTransformer, WebRequest
|
||||
|
||||
|
||||
def test_webdata_bibtexttransform(source_data: str = "RIS"):
|
||||
request = WebRequest().get_ppn("ST 250 U42 (15) ").get_data()
|
||||
assert isinstance(request, list) is True
|
||||
assert len(request)>0
|
||||
model:BookData = BibTextTransformer(source_data).get_data(request).return_data()
|
||||
assert len(request) > 0
|
||||
model: BookData = BibTextTransformer(source_data).get_data(request).return_data()
|
||||
assert model is not None
|
||||
assert model.signature =="ST 250 U42 (15)"
|
||||
assert model.signature == "ST 250 U42 (15)"
|
||||
assert model.ppn == "1693321114"
|
||||
assert model.author == "Ullenboom, Christian"
|
||||
assert model.link == "https://rds.ibs-bw.de/phfreiburg/link?kid=1693321114"
|
||||
assert model.pages=="1246"
|
||||
assert model.publisher=="Rheinwerk Computing"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
assert model.pages == "1246"
|
||||
assert model.publisher == "Rheinwerk Computing"
|
||||
|
||||
BIN
testing.txt
Normal file
BIN
testing.txt
Normal file
Binary file not shown.
Reference in New Issue
Block a user