Setup LSP and clear all lint

This commit is contained in:
Christopher T. Johnson
2024-03-11 17:06:25 -04:00
parent 4ef4fc7d07
commit 7f01c8d040
8 changed files with 55 additions and 100 deletions

21
lib/utils.py Normal file
View File

@@ -0,0 +1,21 @@
"""Utility Functions."""
from typing import NoReturn
from PyQt6.QtCore import QCoreApplication
from PyQt6.QtSql import QSqlQuery
translate = QCoreApplication.translate
def query_error(query: QSqlQuery) -> NoReturn:
"""Standarized query error reporter."""
print(
translate("MainWindow", "SQL Error:\n")
+ "{}\n{}\n{}:{}".format(
query.executedQuery(),
query.boundValues(),
query.lastError().type(),
query.lastError().text(),
)
)
raise Exception(translate("MainWindow", "SQL Error"))