-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
61 lines (55 loc) · 2.91 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
53
54
55
56
57
58
59
60
61
import sys
from PyQt5 import QtCore, Qt
from PyQt5.QtWidgets import QMessageBox, QApplication
from selenium.common.exceptions import SessionNotCreatedException
from app.main_widget import Splashscreen
from app.main_window import MainWindow
import resources
def main():
try:
app = QApplication(sys.argv)
splash = Splashscreen()
window = MainWindow()
window.show()
splash.stop(window)
app.exec()
except SessionNotCreatedException as e:
msgBox = QMessageBox()
msgBox.setWindowModality(QtCore.Qt.WindowModal)
msgBox.setWindowFlags(QtCore.Qt.ToolTip | QtCore.Qt.WindowStaysOnTopHint)
msgBox.setIcon(QMessageBox.Information)
msgBox.setTextFormat(QtCore.Qt.RichText)
msgBox.setText("You need to update Chromedriver!<br><a href='https://chromedriver.chromium.org/downloads'>UPDATE HERE</a>")
msgBox.setDetailedText(str(e))
msgBox.setStandardButtons(QMessageBox.Cancel)
msgBox.setStyleSheet(
'QMessageBox {background-color: rgb(53, 53, 53); border-top: 1px solid rgb(115, 115, 115);'
'border-left: 1px solid rgb(115, 115, 115); border-right: 1px solid rgb(115, 115, 115);'
'border-bottom: 1px solid rgb(115, 115, 115); font-family: "Segoe UI";}'
'QLabel {color: rgb(235, 235, 235); padding-top: 10px; font-family: "Segoe UI";}'
'QPushButton {background-color: rgb(115, 115, 115); color: rgb(235, 235, 235);'
'border-radius: 11px; padding: 5px; min-width: 5em; font-family: "Segoe UI"; font-size: 12px;}'
'QPushButton:pressed {background-color: rgb(53, 53, 53)}'
'QPushButton:hover {border: 0.5px solid white}')
msgBox.exec()
except Exception as e:
msgBox = QMessageBox()
msgBox.setWindowModality(QtCore.Qt.WindowModal)
msgBox.setWindowFlags(QtCore.Qt.ToolTip | QtCore.Qt.WindowStaysOnTopHint)
msgBox.setIcon(QMessageBox.Information)
msgBox.setText('Unknown error..')
msgBox.setDetailedText(str(e))
msgBox.setStandardButtons(QMessageBox.Ok)
msgBox.setDefaultButton(QMessageBox.Ok)
msgBox.setStyleSheet(
'QMessageBox {background-color: rgb(53, 53, 53); border-top: 1px solid rgb(115, 115, 115);'
'border-left: 1px solid rgb(115, 115, 115); border-right: 1px solid rgb(115, 115, 115);'
'border-bottom: 1px solid rgb(115, 115, 115); font-family: "Segoe UI";}'
'QLabel {color: rgb(235, 235, 235); padding-top: 10px; font-family: "Segoe UI";}'
'QPushButton {background-color: rgb(115, 115, 115); color: rgb(235, 235, 235);'
'border-radius: 11px; padding: 5px; min-width: 5em; font-family: "Segoe UI"; font-size: 12px;}'
'QPushButton:pressed {background-color: rgb(53, 53, 53)}'
'QPushButton:hover {border: 0.5px solid white}')
msgBox.exec()
if __name__ == "__main__":
main()