class RedditNews(object): def __init__(self): self.Jarvis = Jarvis() def Say(self, text): self.result = text.encode('ascii', 'ignore') self.Jarvis.Say(self.result) self.Jarvis.Say(" ") def get_headlines(self, limit=10): self.r = praw.Reddit( user_agent="Lyndon's news reader by /u/LyndonArmitage") self.subs = self.r.get_subreddit("worldnews").get_hot(limit=limit) self.headlines = [] for sub in self.subs: self.headlines.append(sub.title) self.first = " ".join(self.headlines) self.news = self.first.replace(".", ". \n\nNext\n\n") self.news.encode('ascii', 'ignore') return self.news def speak_headlines(self, news=[]): try: print self.news self.Say(news) except KeyboardInterrupt: print "\n[*] User requested shutdown" Jarvis.Say("See you soon sir") exit() except Exception as e: print "[!] Exception caught: {}".format(e)
def speak_headlines(self, news=[]): try: print self.news self.Say(news) except KeyboardInterrupt: print "\n[*] User requested shutdown" Jarvis.Say("See you soon sir") exit() except Exception as e: print "[!] Exception caught: {}".format(e)
def __init__(self): self.Jarvis = Jarvis()
class Processor(object): name = "Jarvis-Processor" desc = "Console to process voice commands" version = "0.3" def __init__(self): self.Jarvis = Jarvis() def help(self, version): print print color("[ Jarvis - Personal Assistence - v{} ]".format(version), "blue") print print print color("[*] exit |or| quit : Terminate the program.", "blue") print print print color( "[*] sleep |or| stop |or| wait: Sleep until you say 'Jarvis'.", "blue") print print print color( "[*] newspaper |or| news: Read the top trending news from reddit.", "blue") print print print color( "[*] say |or| speak [message]: Ask Jarvis to say something.", "blue") print print color(" examples(say):", "green") print print color(" say I like donuts", "green") print color(" speak my name is Jarvis", "green") print print print color( "[*] run [script]: Run .sh script that you place on the scripts folder with chmod +x", "blue") print print color(" example(say):", "green") print print color( " run firewall | Place a firewall.sh on the scripts folder and give execution privilege first.", "green") print print print color( "[*] browser: Ask Jarvis to start your default browser.", "blue") print print color(" example(say):", "green") print print color(" browser", "green") print print print color("[*] terminal: Ask Jarvis to open a gnome-terminal.", "blue") print print color(" example(say):", "green") print print color(" terminal", "green") print print print color( "[*] search [query] Ask Jarvis to search query via google.", "blue") print print color(" example(say):", "green") print print color(" search python programming.", "green") print print print color( "[*] input [keystroke]: Send a command to the Arduino Leonardo without entering editor mode.", "blue") print print color(" * ARDUINO LEONARDO REQUIRED *", "red") print print color("voice commands: (Same as EDITOR MODE )", "yellow") print print print color("[*] editor: Start the editor mode.", "blue") print print color(" * ARDUINO LEONARDO REQUIRED *", "red") print print color(" [EDITOR MODE]", "red") print print color("voice commands: (anything else will be typed)", "yellow") print print color(" forward = tab", "green") print color(" back = (shift+tab)", "green") print color(" up = up arrow", "green") print color(" down = down arrow", "green") print color(" right = right arrow", "green") print color(" left = left arrow", "green") print color(" super = super/windows", "green") print color(" slash = slash(/)", "green") print color(" backspace = backspace(erase character)", "green") print color(" erase = press backspace 10 times", "green") print color(" space = space(spacebar)", "green") print color(" enter = enter(return)", "green") print color(" close = close(alt+f4)", "green") print color(" escape = escape(esc)", "green") print color(" exit = leaves editor mode", "green") print def start(self): try: self.Jarvis.ser.open() except Exception as e: print "[!] Arduino Leonardo not found, features that use keyboard will not work." try: self.Jarvis.Say(self.Jarvis.random('greetings')) while 1: try: self.command = self.Jarvis.Listen() self.message = self.command.split() self.input_list = [str(a) for a in self.message] if self.input_list[0] == "exit" or self.input_list[ 0] == "quit": self.Jarvis.Say(self.Jarvis.random('salutes')) exit() elif self.input_list[0] == "sleep" or self.input_list[ 0] == "stop" or self.input_list[0] == "wait": self.Jarvis.Say("Call me if you need me sir.") while 1: self.wait = self.Jarvis.Listen() if self.wait == "Jarvis": self.Jarvis.Say( self.Jarvis.random('affirmative')) break elif self.input_list[0] == "newspaper" or self.input_list[ 0] == "news": self.Jarvis.Say("Here are the news sir.") self.titles = self.Jarvis.GetNews() self.Jarvis.SpeakNews(self.titles) elif self.input_list[0] == "browser": try: webbrowser.open("https://www.google.com") self.Jarvis.Say(self.Jarvis.random('affirmative')) except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "terminal": try: os.system("gnome-terminal") self.Jarvis.Say(self.Jarvis.random('affirmative')) except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "search": try: search = self.input_list[1:] real = "".join(search) url = "https://www.google.com/search?q={}".format( real) webbrowser.open(url) self.Jarvis.Say(self.Jarvis.random('affirmative')) except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "say" or self.input_list[ 0] == "speak": self.Jarvis.Say(self.input_list[1:]) elif self.input_list[0] == "run": self.Jarvis.Say(self.Jarvis.random('affirmative')) os.system("./scripts/{}.sh".format(self.input_list[1])) elif self.input_list[0] == "input": try: self.Jarvis.SerialWrite(self.input_list[1]) self.Jarvis.Say(self.Jarvis.random('affirmative')) except: self.Jarvis.Say( "Feature not working master, plug your Arduino Leonardo then restart the program." ) pass elif self.input_list[0] == "editor": self.Jarvis.Say("Starting edition mode sir.") while 1: self.editmode = self.Jarvis.Listen() self.mesg = self.editmode #self.msg = "".join(self.mesg) if self.mesg is not None: try: self.Jarvis.SerialWrite(self.mesg) self.Jarvis.Say( self.Jarvis.random('affirmative')) except: self.Jarvis.Say( "Feature not working, plug you Arduino Leonardo then restart the program." ) break else: pass if self.editmode == "exit": self.Jarvis.Say("Stoping edition mode sir.") break else: print '[!] Input a valid option, enter "help" to see valid commands.' self.Jarvis.Say("i heard, {}".format(self.command)) self.Jarvis.Say(self.Jarvis.random('dntunderstand')) except IndexError: pass except AttributeError: pass except KeyboardInterrupt: print "\n[*] User requested shutdown" self.Jarvis.Say(self.Jarvis.random('salutes')) exit() except Exception as e: print "[!] Exception caught: {}".format(e) def backgroundstart(self, path): try: with open("{}/log/jarvis.log".format(path), "a+") as stdout: self.p = subprocess.Popen( ["python {}/core/processor.py".format(path)], shell=True, stdout=stdout, stderr=stdout) return except Exception as e: print "[-] Problem starting Jarvis in background: {}".format(e)
def __init__(self, version): self.version = version self.arpmode = "rep" self.Jarvis = Jarvis()
class Processor(object): def __init__(self, version): self.version = version self.arpmode = "rep" self.Jarvis = Jarvis() def start(self): try: while 1: self.command = raw_input("pythem> ") self.argv = self.command.split() self.input_list = [str(a) for a in self.argv] try: if self.command == "help": print_help(self.version) elif self.command == "jarvis-help": jarvis_help("0.0.5") elif self.command == "jarvis": self.Jarvis.start('core/start.py') elif self.command == "exit" or self.command == "quit": exit() elif self.input_list[0] == "set" or self.input_list[ 0] == "SET": if self.input_list[1] == "interface": try: self.interface = raw_input( "[+] Enter the interface: ") except KeyboardInterrupt: pass elif self.input_list[1] == "gateway": try: self.gateway = raw_input( "[+] Enter the gateway: ") except KeyboardInterrupt: pass elif self.input_list[1] == "target": try: self.targets = raw_input( "[+] Enter the target(s): ") except KeyboardInterrupt: pass elif self.input_list[1] == "file": try: self.file = raw_input( "[+] Enter the path to the file: ") except KeyboardInterrupt: pass elif self.input_list[1] == "arpmode": try: self.arpmode = raw_input( "[+] Enter the arpmode:") except KeyboardInterrupt: pass elif self.command == "scan": print "[*] Select one scan mode, options = tcp/arp/manual" mode = raw_input("[+] Scan mode: ") if self.targets is not None and self.interface is not None: try: from modules.scanner import Scanner self.scan = Scanner(self.targets, self.interface, mode) self.scan.start() except KeyboardInterrupt: pass else: print "[!] You probably forgot to set the interface or a valid IP address/range" elif self.input_list[0] == "arpspoof": try: myip = get_myip(self.interface) mymac = get_mymac(self.interface) from modules.arpoisoner import ARPspoof self.spoof = ARPspoof(self.gateway, self.targets, self.interface, self.arpmode, myip, mymac) if self.input_list[1] == "start": self.spoof.start() print "[+] ARP spoofing initialized." elif self.input_list[1] == "stop": self.spoof.stop() print "[+] ARP spoofing finalized." else: print "[!] You probably forgot to type start or stop after arpspoof." except Exception as e: print "[!] Exception caught: {}".format(e) elif self.input_list[0] == "dnsspoof": try: if self.input_list[1] == "start": domain = raw_input( "[+] Domain to be spoofed: ") redirect = raw_input( "[+] IP address to be redirected: ") from modules.dnspoisoner import DNSspoof self.dnsspoof = DNSspoof(domain, redirect) self.dnsspoof.start() print "[+] DNS spoofing initialized" elif self.input_list[1] == "stop": self.dnsspoof.stop() print "[+] DNS spoofing finalized" else: print "[!] You probably forgot to type start or stop after dnsspoof." except Exception as e: print "[!] Exception caught: {}".format(e) elif self.command == "sniff": filter = raw_input("[+] Enter the filter: ") try: from modules.sniffer import Sniffer self.sniff = Sniffer(self.interface, filter) self.sniff.start() except KeyboardInterrupt: pass elif self.command == "pforensic": try: from modules.pforensic import PcapReader self.pcapread = PcapReader(self.file) self.pcapread.start() except KeyboardInterrupt: pass except TypeError: print "[!] You probably forgot to set the .pcap file" pass except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.command == "cookiedecode": try: cookiedecode() except KeyboardInterrupt: pass except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "decode": try: print decode(self.input_list[1]) except KeyboardInterrupt: pass elif self.input_list[0] == "encode": try: print encode(self.input_list[1]) except KeyboardInterrupt: pass elif self.command == "geoip": if self.targets is not None: try: from modules.geoip import Geoip path = "config/GeoLiteCity.dat" iptracker = Geoip(self.targets, path) except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "brute-force": if self.input_list[1] == "ssh": try: username = raw_input( "[+] Enter the username to bruteforce: ") from modules.ssh_bruter import SSHbrutus brutus = SSHbrutus(self.targets, username, self.file) brutus.start() except KeyboardInterrupt: brutus.stop() pass except TypeError: print "[!] You probably forgot to set the wordlist file path." pass elif self.input_list[1] == "url": try: url = 'url' from modules.web_bruter import WEBbrutus brutus = WEBbrutus(self.targets, self.file) brutus.start(url) except KeyboardInterrupt: brutus.stop(url) pass except TypeError: print "[!] You probably forgot to set the wordlist file path." pass elif self.input_list[1] == "webform": try: form = 'form' from modules.web_bruter import WEBbrutus brutus = WEBbrutus(self.targets, self.file) brutus.start(form) except KeyboardInterrupt: brutus.stop(form) pass except TypeError: print "[!] You probably forgot to set the wordlist file path." pass else: print "[!] Select a valid type of brute-force type help to check." else: try: os.system("{}".format(self.command)) pass except Exception as e: print "[!] Select a valid option, type help to check sintax." pass except IndexError: pass except Exception as e: print "Exception caught: {}".format(e) except KeyboardInterrupt: print "\n[*] User requested shutdown." exit()
class Processor(object): name = "Jarvis-Processor" desc = "Console to process voice commands" version = "0.3" def __init__(self): self.Jarvis = Jarvis() def help(self,version): print print color("[ Jarvis - Personal Assistence - v{} ]".format(version),"blue") print print print color("[*] exit |or| quit : Terminate the program.","blue") print print print color("[*] sleep |or| stop |or| wait: Sleep until you say 'Jarvis'.","blue") print print print color("[*] newspaper |or| news: Read the top trending news from reddit.","blue") print print print color("[*] say |or| speak [message]: Ask Jarvis to say something.","blue") print print color(" examples(say):","green") print print color(" say I like donuts","green") print color(" speak my name is Jarvis","green") print print print color("[*] run [script]: Run .sh script that you place on the scripts folder with chmod +x","blue") print print color(" example(say):","green") print print color(" run firewall | Place a firewall.sh on the scripts folder and give execution privilege first.","green") print print print color("[*] browser: Ask Jarvis to start your default browser.","blue") print print color(" example(say):","green") print print color(" browser","green") print print print color("[*] terminal: Ask Jarvis to open a gnome-terminal.","blue") print print color(" example(say):","green") print print color(" terminal","green") print print print color("[*] search [query] Ask Jarvis to search query via google.","blue") print print color(" example(say):","green") print print color(" search python programming.","green") print print print color("[*] input [keystroke]: Send a command to the Arduino Leonardo without entering editor mode.","blue") print print color(" * ARDUINO LEONARDO REQUIRED *","red") print print color("voice commands: (Same as EDITOR MODE )","yellow") print print print color("[*] editor: Start the editor mode.","blue") print print color(" * ARDUINO LEONARDO REQUIRED *","red") print print color(" [EDITOR MODE]","red") print print color("voice commands: (anything else will be typed)","yellow") print print color(" forward = tab","green") print color(" back = (shift+tab)","green") print color(" up = up arrow","green") print color(" down = down arrow","green") print color(" right = right arrow","green") print color(" left = left arrow","green") print color(" super = super/windows","green") print color(" slash = slash(/)","green") print color(" backspace = backspace(erase character)","green") print color(" erase = press backspace 10 times","green") print color(" space = space(spacebar)","green") print color(" enter = enter(return)","green") print color(" close = close(alt+f4)","green") print color(" escape = escape(esc)","green") print color(" exit = leaves editor mode","green") print def start(self): try: self.Jarvis.ser.open() except Exception as e: print "[!] Arduino Leonardo not found, features that use keyboard will not work." try: self.Jarvis.Say(self.Jarvis.random('greetings')) while 1: try: self.command = self.Jarvis.Listen() self.message = self.command.split() self.input_list = [str(a) for a in self.message] if self.input_list[0] == "exit" or self.input_list[0] == "quit": self.Jarvis.Say(self.Jarvis.random('salutes')) exit() elif self.input_list[0] == "sleep" or self.input_list[0] == "stop" or self.input_list[0] == "wait": self.Jarvis.Say("Call me if you need me sir.") while 1: self.wait = self.Jarvis.Listen() if self.wait == "Jarvis": self.Jarvis.Say(self.Jarvis.random('affirmative')) break elif self.input_list[0] == "newspaper" or self.input_list[0] == "news": self.Jarvis.Say("Here are the news sir.") self.titles = self.Jarvis.GetNews() self.Jarvis.SpeakNews(self.titles) elif self.input_list[0] == "browser": try: webbrowser.open("https://www.google.com") self.Jarvis.Say(self.Jarvis.random('affirmative')) except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "terminal": try: os.system("gnome-terminal") self.Jarvis.Say(self.Jarvis.random('affirmative')) except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "search": try: search = self.input_list[1:] real = "".join(search) url = "https://www.google.com/search?q={}".format(real) webbrowser.open(url) self.Jarvis.Say(self.Jarvis.random('affirmative')) except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "say" or self.input_list[0] == "speak": self.Jarvis.Say(self.input_list[1:]) elif self.input_list[0] == "run": self.Jarvis.Say(self.Jarvis.random('affirmative')) os.system("./scripts/{}.sh".format(self.input_list[1])) elif self.input_list[0] == "input": try: self.Jarvis.SerialWrite(self.input_list[1]) self.Jarvis.Say(self.Jarvis.random('affirmative')) except: self.Jarvis.Say("Feature not working master, plug your Arduino Leonardo then restart the program.") pass elif self.input_list[0] == "editor": self.Jarvis.Say("Starting edition mode sir.") while 1: self.editmode = self.Jarvis.Listen() self.mesg = self.editmode #self.msg = "".join(self.mesg) if self.mesg is not None: try: self.Jarvis.SerialWrite(self.mesg) self.Jarvis.Say(self.Jarvis.random('affirmative')) except: self.Jarvis.Say("Feature not working, plug you Arduino Leonardo then restart the program.") break else: pass if self.editmode == "exit": self.Jarvis.Say("Stoping edition mode sir.") break else: print '[!] Input a valid option, enter "help" to see valid commands.' self.Jarvis.Say("i heard, {}".format(self.command)) self.Jarvis.Say(self.Jarvis.random('dntunderstand')) except IndexError: pass except AttributeError: pass except KeyboardInterrupt: print "\n[*] User requested shutdown" self.Jarvis.Say(self.Jarvis.random('salutes')) exit() except Exception as e: print "[!] Exception caught: {}".format(e) def backgroundstart(self,path): try: with open("{}/log/jarvis.log".format(path),"a+") as stdout: self.p = subprocess.Popen(["python {}/core/processor.py".format(path)], shell=True, stdout=stdout, stderr=stdout) return except Exception as e: print "[-] Problem starting Jarvis in background: {}".format(e)
class Processor(object): def __init__(self, version): self.version = version self.arpmode = "rep" self.Jarvis = Jarvis() def start(self): try: while 1: self.command = raw_input("pythem> ") self.argv = self.command.split() self.input_list = [str(a) for a in self.argv] try: if self.command == "help": print_help(self.version) elif self.command == "jarvis-help": jarvis_help("0.0.5") elif self.command == "jarvis": self.Jarvis.start('core/start.py') elif self.command == "exit" or self.command == "quit": exit() elif self.input_list[0] == "set" or self.input_list[0] == "SET": if self.input_list[1] == "interface": try: self.interface = raw_input("[+] Enter the interface: ") except KeyboardInterrupt: pass elif self.input_list[1] == "gateway": try: self.gateway = raw_input("[+] Enter the gateway: ") except KeyboardInterrupt: pass elif self.input_list[1] == "target": try: self.targets = raw_input("[+] Enter the target(s): ") except KeyboardInterrupt: pass elif self.input_list[1] == "file": try: self.file = raw_input("[+] Enter the path to the file: ") except KeyboardInterrupt: pass elif self.input_list[1] == "arpmode": try: self.arpmode = raw_input("[+] Enter the arpmode:") except KeyboardInterrupt: pass elif self.command == "scan": print "[*] Select one scan mode, options = tcp/arp/manual" mode = raw_input("[+] Scan mode: ") if self.targets is not None and self.interface is not None: try: from modules.scanner import Scanner self.scan = Scanner(self.targets, self.interface, mode) self.scan.start() except KeyboardInterrupt: pass else: print "[!] You probably forgot to set the interface or a valid IP address/range" elif self.input_list[0] == "arpspoof": try: myip = get_myip(self.interface) mymac = get_mymac(self.interface) from modules.arpoisoner import ARPspoof self.spoof = ARPspoof(self.gateway, self.targets, self.interface,self.arpmode ,myip, mymac) if self.input_list[1] == "start": self.spoof.start() print "[+] ARP spoofing initialized." elif self.input_list[1] == "stop": self.spoof.stop() print "[+] ARP spoofing finalized." else: print "[!] You probably forgot to type start or stop after arpspoof." except Exception as e: print "[!] Exception caught: {}".format(e) elif self.input_list[0] == "dnsspoof": try: if self.input_list[1] == "start": domain = raw_input("[+] Domain to be spoofed: ") redirect = raw_input("[+] IP address to be redirected: ") from modules.dnspoisoner import DNSspoof self.dnsspoof = DNSspoof(domain, redirect) self.dnsspoof.start() print "[+] DNS spoofing initialized" elif self.input_list[1] == "stop": self.dnsspoof.stop() print "[+] DNS spoofing finalized" else: print "[!] You probably forgot to type start or stop after dnsspoof." except Exception as e: print "[!] Exception caught: {}".format(e) elif self.command == "sniff": filter = raw_input("[+] Enter the filter: ") try: from modules.sniffer import Sniffer self.sniff = Sniffer(self.interface, filter) self.sniff.start() except KeyboardInterrupt: pass elif self.command == "pforensic": try: from modules.pforensic import PcapReader self.pcapread = PcapReader(self.file) self.pcapread.start() except KeyboardInterrupt: pass except TypeError: print "[!] You probably forgot to set the .pcap file" pass except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.command == "cookiedecode": try: cookiedecode() except KeyboardInterrupt: pass except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "decode": try: print decode(self.input_list[1]) except KeyboardInterrupt: pass elif self.input_list[0] == "encode": try: print encode(self.input_list[1]) except KeyboardInterrupt: pass elif self.command == "geoip": if self.targets is not None: try: from modules.geoip import Geoip path = "config/GeoLiteCity.dat" iptracker = Geoip(self.targets,path) except Exception as e: print "[!] Exception caught: {}".format(e) pass elif self.input_list[0] == "brute-force": if self.input_list[1] == "ssh": try: username = raw_input("[+] Enter the username to bruteforce: ") from modules.ssh_bruter import SSHbrutus brutus = SSHbrutus(self.targets, username, self.file) brutus.start() except KeyboardInterrupt: brutus.stop() pass except TypeError: print "[!] You probably forgot to set the wordlist file path." pass elif self.input_list[1] == "url": try: url = 'url' from modules.web_bruter import WEBbrutus brutus = WEBbrutus(self.targets, self.file) brutus.start(url) except KeyboardInterrupt: brutus.stop(url) pass except TypeError: print "[!] You probably forgot to set the wordlist file path." pass elif self.input_list[1] == "webform": try: form = 'form' from modules.web_bruter import WEBbrutus brutus = WEBbrutus(self.targets, self.file) brutus.start(form) except KeyboardInterrupt: brutus.stop(form) pass except TypeError: print "[!] You probably forgot to set the wordlist file path." pass else: print "[!] Select a valid type of brute-force type help to check." else: try: os.system("{}".format(self.command)) pass except Exception as e: print "[!] Select a valid option, type help to check sintax." pass except IndexError: pass except Exception as e: print "Exception caught: {}".format(e) except KeyboardInterrupt: print "\n[*] User requested shutdown." exit()
def __init__(self): self.random = Randomstorm() self.Jarvis = Jarvis() self.RedditNews = RedditNews()
class Processor(object): def __init__(self): self.random = Randomstorm() self.Jarvis = Jarvis() self.RedditNews = RedditNews() def start(self): try: self.Jarvis.ser.open() except Exception as e: print "[!] Arduino Leonardo not found, features that use keyboard will not work." try: self.Jarvis.Say(self.random.random('greetings')) while 1: try: self.command = self.Jarvis.Listen() self.message = self.command.split() self.input_list = [str(a) for a in self.message] self.Jarvis.Say("i heard, {}".format(self.command)) if self.input_list[0] == "exit": self.Jarvis.Say(self.random.random('salutes')) exit() elif self.input_list[0] == "sleep": while 1: self.wait = self.Jarvis.Listen() if self.wait == "Jarvis": self.Jarvis.Say( self.random.random('affirmative')) break elif self.input_list[0] == "newspaper": self.Jarvis.Say("Here are the news sir.") self.titles = self.RedditNews.get_headlines() self.RedditNews.speak_headlines(self.titles) elif self.input_list[0] == "start": self.Jarvis.SerialWrite(self.input_list[1]) self.Jarvis.Say(self.random.random('affirmative')) elif self.input_list[0] == "say": self.Jarvis.Say(self.input_list[1:]) elif self.input_list[0] == "run": self.Jarvis.Say(self.random.random('affirmative')) os.system("./scripts/{}.sh".format(self.input_list[1])) elif self.input_list[0] == "editor": self.Jarvis.Say("Starting edition mode sir.") while 1: self.editmode = self.Jarvis.Listen() self.mesg = self.editmode #self.msg = "".join(self.mesg) if self.mesg is not None: try: self.Jarvis.SerialWrite(self.mesg) self.Jarvis.Say( self.random.random('affirmative')) except: print "[!] Feature not working, plug you Arduino Leonardo then try again." break else: pass if self.editmode == "exit": self.Jarvis.Say("Stoping edition mode sir.") break else: print '[!] Input a valid option, enter "help" to see valid commands.' self.Jarvis.Say(self.random.random('dntunderstand')) except IndexError: pass except AttributeError: pass except KeyboardInterrupt: print "\n[*] User requested shutdown" self.Jarvis.Say(self.random.random('salutes')) exit() except Exception as e: print "[!] Exception caught: {}".format(e)