forked from BetaRavener/uPyLoader
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
57 lines (45 loc) · 1.53 KB
/
Copy pathmain.py
File metadata and controls
57 lines (45 loc) · 1.53 KB
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
import sys
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication
from src.gui.main_window import MainWindow
from src.helpers.pyinstaller_helper import PyInstallerHelper
from src.utility.settings import Settings
__author__ = "Ivan Sevcik"
def onHotswap():
"""Called when the source of this module has changed.
When a function named 'onHotswap' is present in a module,
this function is called after the module is reloaded.
This should be used to trigger a redisplay of the screen or
in general to discard cached results that are to be calculated
again using the new method definitions.
If onHotswap is not defined the module is reloaded anyway, but afterwards
no further actions are performed. In this case the changed code has to be
activated some other way like minimizing and restoring the window to be
repainted.
"""
print("Update!")
for widget in myApp.allWidgets():
widget.update()
# Main Function
def main(argv=None):
if argv is None:
import sys
argv = sys.argv
# Create main app
global myApp
myApp = QApplication(sys.argv)
myApp.setQuitOnLastWindowClosed(True)
path = PyInstallerHelper.resource_path("icons\\main.png")
icon = QIcon(path)
myApp.setWindowIcon(icon)
try:
sys.argv.index("--debug")
Settings().debug_mode = True
except ValueError:
pass
ex2 = MainWindow()
ex2.show()
# Execute the Application and Exit
sys.exit(myApp.exec_())
if __name__ == '__main__':
main()