def getHostFromUser(): terminal.clear() print("What is the host name (" + interface.getHost()[0] + ")?") newhost = terminal.getInput(">> ") if (newhost == ""): newhost = interface.getHost()[0] return newhost
def getPortFromUser(): terminal.clear() print("What is the host port (" + str(interface.getHost()[1]) + ")?") newport = terminal.getInput(">> ") if (newport == ""): newport = interface.getHost()[1] else: newport = int(newport) return newport
def getUserNameFromUser(): userName = "" while (userName == "" or userName[0:5] == "sudo,"): print("What is your name?") userName = terminal.getInput(">> ") terminal.clear() # If it is a sudo command, do it if (userName[0:5] == "sudo,"): handleSudoCommand(userName[6:]) return userName
def exitWhenUserReady(): printErrors() terminal.getInput("Press any key to continue...")