-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
135 lines (94 loc) · 3.84 KB
/
run.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#this file is use to run the gui application
from jarvis import jarvis
import sys
import datetime
import time
from jarvis import jarvis
from PyQt5 import QtWidgets , QtCore , QtGui
from PyQt5.QtCore import QTimer , QTime , QDate , Qt
from PyQt5.QtGui import QMovie
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.uic import loadUiType
from jarvis_ui import Ui_jarvisGui
from speak import speak
class MainThread(QThread):
def __init__(self):
super(MainThread,self).__init__()
def run(self):
speak('System has initialised properly .. Your a i assistant is ready to use')
speak('Speak jarvis or hey jarvis to use')
jarvis() #to start the main program
startExecution = MainThread() #object of mainthread class
class Main(QMainWindow):
def __init__(self):
super().__init__()
self.ui = Ui_jarvisGui()
self.ui.setupUi(self)
self.ui.pushButton1.clicked.connect(self.startTask)
def startTask(self):
self.ui.pushButton1.hide()
self.label3_load()
self.label4_load()
try:
timer = QTimer(self)
timer.timeout.connect(self.showTime)
timer.start()
except Exception as e :
pass
self.label2_load()
self.label1_load()
self.label6_load()
self.label7_load()
startExecution.start()
def showTime(self):
now = datetime.datetime.now()
current_time = now.strftime("%I:%M:%S %p")
current_date = now.strftime("%d/%m/%y")
self.ui.label5.setHidden(False)
self.ui.textBrowser1.setText(current_time)
self.ui.textBrowser2.setText(current_date)
def label1_load(self):
#to run the gui at label3
self.ui.movie_l1 = QtGui.QMovie("img/1.gif")
self.ui.label1.setMovie(self.ui.movie_l1)
self.ui.movie_l1.start()
def label2_load(self):
#to run the gui at label3
self.ui.label2.setHidden(False) #making label 2 visible
self.ui.movie_l2 = QtGui.QMovie("img/2.gif")
self.ui.label2.setMovie(self.ui.movie_l2)
self.ui.movie_l2.setSpeed(130)
self.ui.movie_l2.start()
def label3_load(self): #to load label 3
#to speak
speak("Initializing System")
#to run the gui at label3
self.ui.label3.setHidden(False) #making label 3 visible
self.ui.movie_l3 = QtGui.QMovie("img/3.gif")
self.ui.label3.setMovie(self.ui.movie_l3)
self.ui.movie_l3.start()
def label4_load(self): #making label 4 visible
speak("Please Hold on ,Loading Disks , Checking Security")
speak("Launching User Interface")
self.ui.label4.setHidden(False) #making label 4 visible
self.ui.movie_l4 = QtGui.QMovie("img/4.gif")
self.ui.label4.setMovie(self.ui.movie_l4)
self.ui.movie_l4.start()
def label6_load(self): #making label 6 visible
self.ui.label6.setHidden(False) #making label 6 visible
self.ui.movie_l6 = QtGui.QMovie("img/6.gif")
self.ui.label6.setMovie(self.ui.movie_l6)
self.ui.movie_l6.setSpeed(50)
self.ui.movie_l6.start()
def label7_load(self): #making label 7 visible
self.ui.label7.setHidden(False) #making label 7 visible
self.ui.movie_l7 = QtGui.QMovie("img/6.gif")
self.ui.label7.setMovie(self.ui.movie_l7)
self.ui.movie_l7.setSpeed(50)
self.ui.movie_l7.start()
app = QApplication(sys.argv)
jarvis1 = Main()
jarvis1.show()
exit(app.exec_())