def getCommand(self): text = JARVIS.getCommand() #print(text) #threading.Timer(3.0, self.checkCommand).start() thread2 = threading.Thread(target=self.checkCommand) thread2.setDaemon(True) thread2.start() return text
from JARVIS import JARVIS jarvis = JARVIS() while True: jarvis.takeCommand()
def saveUrl(self, name, url): urlFile = open(r"database/urls.txt", "a+") urlFile.write("\n" + name + ' = \"' + url + '\"') urlFile.close() JARVIS.checkUrls()
def checkCommand(self): response = JARVIS.checkCommand()
def saveSel(self, name, usernameSel, passwdSel): selFile = open(r"database/urlSelector.txt", "a+") selFile.write("\n" + name + ' = ' + usernameSel + ';' + passwdSel) selFile.close() JARVIS.checkSelectors()
def saveAcc(self, name, username, passwd): accFile = open(r"database/accounts.txt", "a+") accFile.write("\n" + name + ' = ' + username + ';' + passwd) accFile.close() JARVIS.checkAccounts()
def saveDir(self, name, dirr): dirFile = open(r"database/directories.txt", "a+") dirFile.write("\n" + name + ' = \"' + dirr + '\"') dirFile.close() JARVIS.checkDirectories()
import threading import time import sys import random import webview from JARVIS import JARVIS import json # from webview.platforms.cef import settings # settings.update({ # 'persist_session_cookies': True # }) JARVIS = JARVIS() class Api: def checkCreds(self, user, passwd): if (user == "r") and (passwd == "r"): response = { "message": "Redirecting to JARVIS Dashboard.", "valid": "yes" } threading.Timer(0.1, JARVIS.speak, [response["message"]]).start() threading.Timer( 3.0, changeWindow, ["templates/index.html", "JARVIS | Dashboard"]).start() return response