-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·52 lines (38 loc) · 1.61 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
import sys
from PyQt5.QtCore import qInstallMessageHandler, QUrl
from PyQt5.QtQml import qmlRegisterType, QQmlApplicationEngine
from PyQt5.QtWidgets import QApplication
# noinspection PyUnresolvedReferences
import resources_rc
from src.models import DSABaseModel, DSAKeygenModel, DSAKeysReaderModel, \
DSAKeysWriterModel, DSASignCheckerModel, DSASignerModel, \
SchnorrSchemeClientModel, SchnorrSchemeKeygenModel, \
SchnorrSchemeValidatorModel
MAIN_QML = QUrl("qrc:///main.qml")
MODULES_IMPORT_PATH = "qrc:///modules"
def handleStatusChange(mode, message, context):
print(mode)
print(message, context)
def main():
app = QApplication(sys.argv)
qInstallMessageHandler(handleStatusChange)
qmlRegisterType(DSAKeygenModel, "dsa", 1, 0, "DSAKeygen")
qmlRegisterType(DSAKeysWriterModel, "dsa", 1, 0, "DSAKeysWriter")
qmlRegisterType(DSAKeysReaderModel, "dsa", 1, 0, "DSAKeysReader")
qmlRegisterType(DSASignerModel, "dsa", 1, 0, "DSASigner")
qmlRegisterType(DSASignCheckerModel, "dsa", 1, 0, "DSASignChecker")
qmlRegisterType(SchnorrSchemeClientModel, "schnorr_scheme", 1, 0,
"SchnorrSchemeClient")
qmlRegisterType(SchnorrSchemeValidatorModel, "schnorr_scheme", 1, 0,
"SchnorrSchemeValidator")
qmlRegisterType(DSABaseModel, "dsa", 1, 0, "DSABaseModel")
qmlRegisterType(SchnorrSchemeKeygenModel, "schnorr_scheme", 1, 0,
"SchnorrSchemeKeygen")
engine = QQmlApplicationEngine()
engine.load(MAIN_QML)
sys.exit(app.exec())
entry_points = {
'__main__': main
}
entry_points[__name__]()