-
Notifications
You must be signed in to change notification settings - Fork 27
/
jarvis.py
39 lines (34 loc) · 1.05 KB
/
jarvis.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
import threading
from internet_check import is_Online
from Alert import Alert
from Data.DLG_Data import online_dlg,offline_dlg
import random
from co_brain import Jarvis
from TextToSpeech.Fast_DF_TTS import speak
from Automation.Battery import check_plug
from Time_Operations.throw_alert import check_schedule,check_Alam
from os import getcwd
Alam_path = f"{getcwd()}\\Alam_data.txt"
file_path = f'{getcwd()}\\schedule.txt'
ran_online_dlg = random.choice(online_dlg)
ran_offline_dlg = random.choice(offline_dlg)
def main():
if is_Online():
t1 = threading.Thread(target=speak,args=(ran_online_dlg,))
t3 = threading.Thread(target=check_plug)
t4 = threading.Thread(target=check_schedule,args=(file_path,))
t5 = threading.Thread(target=Jarvis)
t6 = threading.Thread(target=check_Alam,args=(Alam_path,))
t1.start()
t1.join()
t3.start()
t4.start()
t5.start()
t6.start()
t3.join()
t4.join()
t5.join()
t6.join()
else:
Alert(ran_offline_dlg)
main()