-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainEngine.py
34 lines (29 loc) · 1.06 KB
/
mainEngine.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
from notify import notify
from audioInput import listen
from subprocess import getoutput
from datetime import datetime
from queryResponder import search
def decor(func):
def wrap():
with open("welcome.txt") as fin:
print(fin.read())
func()
print("------------------------------------------------------------------")
return wrap
@decor
def main():
Input=""
notify(message="Service Started",extra="-contentImage ./logo.png -timeout 0.2")
while Input != "terminate":
Input = getoutput("terminal-notifier -title Nancy:The_Virtual_Assistant -message Ask_me_something -appIcon ./final.png -sound default -reply Type_Your_Query_Here")
print('Query= ' + Input)
#Take Input From Microphone
if Input == '@CLOSED' or Input == '@CONTENTCLICKED':
Input = listen()
from logUpdator import update_log
update_log(str(datetime.utcnow()),Input)
print("You said: " + Input)
Input=Input.lower()
search(Input)
if __name__ == '__main__':
main()