Пример #1
0
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)
Пример #2
0
			ui.writeToConsole("Login incorrect")
	
	opsys.setTitleText(TITLE)
	ui.clear()
	ui.setInIDU(False)
	ui.writeToConsole(msgLog)

if __name__ == "__main__":
	"""Initialize and run threads."""
	# Set current mode
	mode[LOCAL_IP] = CHAT
	
	# Clear screen and welcome user
	ui.clear()
	printMsg(etc.welcome(ui.getCols(), VERSION))
	opsys.setTitleText(TITLE)
	
	# Initialize the database module
	dbNick, botResponses = database.initialize(LOCAL_IP)
	
	myNick = dbNick
	
	# Get nickname
	if myNick == None:
		prompt = "Please enter a nickname: "
		myNick = sleepPrompt(prompt)
		msgLog.append(prompt + myNick)
	else:
		returnString = "Welcome back, " + myNick
		printMsg(returnString)
		msgLog.append(returnString)