39 lines
827 B
Python
Executable File
39 lines
827 B
Python
Executable File
#!venv/bin/python3
|
|
import faulthandler
|
|
import sys
|
|
|
|
from PySide6.QtCore import QSettings
|
|
from PySide6.QtSql import (
|
|
QSqlDatabase,
|
|
)
|
|
from PySide6.QtWidgets import (
|
|
QApplication,
|
|
)
|
|
|
|
from lib.utils import openSettings
|
|
|
|
faulthandler.enable()
|
|
|
|
from MainWindow import MainWindow
|
|
|
|
|
|
def main() -> int:
|
|
#
|
|
app = QApplication(sys.argv)
|
|
settings = openSettings('database')
|
|
db = QSqlDatabase.addDatabase("QMYSQL")
|
|
db.setHostName(settings.value("hostname"))
|
|
db.setDatabaseName(settings.value("databasename","scotus")) # type: ignore
|
|
db.setUserName(settings.value("user","scotus")) # type: ignore
|
|
db.setPassword(settings.value("password"))
|
|
settings.endGroup()
|
|
db.open()
|
|
import lib.dbConfig
|
|
|
|
window = MainWindow()
|
|
return app.exec()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|