-
Notifications
You must be signed in to change notification settings - Fork 0
/
goof_script_400.py
executable file
·51 lines (46 loc) · 1.65 KB
/
goof_script_400.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
#!/usr/bin/env python3
import pafy, sys, configurations
from subprocess import Popen, PIPE
from speech.listener import Listener
from common.command_types import CommandTypes
from common.command import Command
from common.exceptions import CancelCommand
from SubtypeProcessors.system_processor import SystemProcessor, SystemCommands
from SubtypeProcessors.audio_processor import AudioProcessor
from SubtypeProcessors.socialmedia_processor import SocialMediaProcessor
def main():
configurations.parseArgs(sys.argv)
listener = Listener()
if configurations.ARGS["quiet"]:
print("Running in quiet mode")
while True:
try:
print("What's up?")
if not configurations.ARGS["quiet"]:
command = Command(listener.listen())
else:
command = Command(input())
if command is not None and command.name is not None:
print("Command " + command.name)
if command.command_type == CommandTypes.AUDIO:
# Music procssor here
audioProcessor = AudioProcessor()
audioProcessor.process(command)
elif command.command_type == CommandTypes.SYSTEM:
#System processor here
systemProcessor = SystemProcessor()
systemProcessor.process(command)
elif command.command_type == CommandTypes.SOCIAL:
mediaProcessor = SocialMediaProcessor()
mediaProcessor.process(command)
elif command.name.lower() == "exit":
print("Exiting")
sys.exit(0)
else:
print("Command not recognized.")
else:
print("I'm sorry, I didn't catch that")
except CancelCommand:
pass
if __name__ == "__main__":
main()