-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
75 lines (67 loc) · 2.02 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
## @file main.py
#
# @brief this file generates the window and calls the window class in window.py
#
# @author JiaJun
#
# @section libraries_main Libraries/Modules
# - sys standard library (https://docs.python.org/3/library/sys.html)
# - access to sys.argv and sys.exit functions
# - PyQt5.QtWidgets external library
# - access to PyQt5 UI Widgets
# - GUIWidgets (local)
# - access to classes from GUIWidgets.py
# - window (local)
# - access to the window class
# - youtube (local)
# - access to the youtube crawler
# - general (local)
# - access to delete_file_contents
# - os external library
# - access to environ
# Imports
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from GUIWidgets import *
from window import window
from youtube import *
from general import delete_file_contents
from os import environ
def suppress_qt_warnings():
"""! this method is used to supressed
"""
environ["QT_DEVICE_PIXEL_RATIO"] = "0"
environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
environ["QT_SCREEN_SCALE_FACTORS"] = "1"
environ["QT_SCALE_FACTOR"] = "1"
RESULT_FILE = 'result.txt'
## Documentation for a UI Class
# Defines the UI object which will create a window and call the window class to load UI
class UI():
"""! UI class
Defines the UI object which will create a window and call the window class to load UI
"""
__wWidth = 1080
__wHeight = 1080
def __init__(self):
"""! UI class initializer
Creates a new empty window and setup the UI
"""
self.win = newWindow("CookieBlade", self.__wWidth, self.__wHeight)
self.win.setStyleSheet("Assets/blank.png")
self.ui = window()
self.ui.setupUi(self.win)
self.ui.stackedWidget.setCurrentWidget(self.ui.mainM.window)
def show(self):
"""! set window to visible
"""
self.win.show()
#start of main
suppress_qt_warnings()
delete_file_contents(RESULT_FILE)
app = startApp()
win = UI()
win.show()
sys.exit(app.QApp.exec_())
delete_file_contents(RESULT_FILE)
#end of main