def main(name): ''' Create a new account for the user based on the name provided, and further questions. ''' paul.interact("Hi there, {}!\n".format(name.title()) + "I'm just creating you an account now.") shutil.copyfile("PAUL/Settings/default.py", "PAUL/Settings/{}.py".format(name.lower())) add_to_system(name) edit_file(name) brain.login(name.lower()) paul.interact("Ok, that should all be set up for you now! " + "Let's give you a run-through of the system.") tutorial.run(name)
def authenticate(self, name, skipped=False): logged_in = brain.login(name) if logged_in: if not skipped: self.purge_login() self.createWidgets() else: self.loginLabel['text'] = 'Login Failed.' self.userName.delete(0, len(name))
def login(splash): ''' Attempt to log the user in. ''' if splash: print("To log in, enter your username below.") print("To create a new user, type 'new user' without quotes.") if brain.paul.system.flags["SKIP_LOGIN"] == False: name = input("Name: ") logged_in = brain.login(name) if logged_in: print("User found.") time.sleep(1) else: print("User not found.") yn = input("Do you wish to log in as a different user? [Y/n] ") if yn.lower().startswith("y"): login() else: print("Using default settings.") time.sleep(1) show_splash() else: brain.login(brain.paul.system.flags["SKIP_LOGIN"])
def new_user(self): self.purge_login() self.createWidgets() logged_in = brain.login('new user')
temp_holder = "" temp_q_holder = "" def get_text_simple(): q = temp_holder code = ('display dialog "' + q + '" default answer ""\n' + 'set res to text returned of result\n' + 'return res') result = brain.paul.run_script(code, language="applescript", response=True) return result def set_text_simple(text): global temp_holder temp_holder = text brain.paul.send_notification(temp_q_holder, text) if len(argv) > 1: brain.login("default") paul = Application(Tk()) setup_gui(paul) brain.set_IO(set_text_simple, get_text_simple) temp_q_holder = " ".join(argv[1:]) brain.process(temp_q_holder) else: main()