def printMsg(msg, log=True): """This handles printing and alerting in the various modes.""" if log: msgLog.append(msg) if mode[LOCAL_IP] == CHAT: ui.writeToConsole(msg) opsys.alert(msg) elif mode[LOCAL_IP] == AWAY: pass elif mode[LOCAL_IP] == SLEEP: opsys.alert("Please update Agave.") elif mode[LOCAL_IP] == HIBERNATE: pass
def emulateIDU(): """Emulate an IDU""" ui.clear() ui.setInIDU(True) ui.writeToConsole(etc.IDU_TEXT) opsys.setTitleText("COM5:38400baud - Tera Term VT") ui.getUserMsg("", sleepEn=False, pwd=True, log=False) getUser = True while getUser: username = "" while username == "": username = ui.getUserMsg("SDIDU login: "******"Password: "******"factory") or (username == "root") if user and ((password == "exit") or (password == "arct1c")): opsys.exit() elif user and (password == "resume"): getUser = False else: ui.writeToConsole("Login incorrect") opsys.setTitleText(TITLE) ui.clear() ui.setInIDU(False) ui.writeToConsole(msgLog)