def add_host(): """ appends an inputted host name to servers.txt :return: None """ host = input("Enter 'user@host' or -1 to exit:") if host != '-1': module.append_file(INPUT_FILE, host)
def add_host(): """ appends an inputted host name to servers.txt :return: None """ host = input("Enter 'user@host' or -1 to exit:") if host != '-1': name = input("Name: ") port = input("Port: ") module.append_file(INPUT_FILE, name + ":" + host + ":" + port)
def add_quote(): """ Adds the quote in the command line arguments to the quotes text file :return: None """ quote = "" for i in range(2, len(sys.argv)): quote = quote + sys.argv[i] quote = quote + " " print("added " + quote + "to " + INPUT_FILE) module.append_file(INPUT_FILE, quote)
def write_to_bash_config(sauce): """ prompts user for name of shell config file and write contents of sauce to it """ path = input("Enter name of shell (.bashrc or .zshrc):") path = "~/" + path for line in sauce: module.append_file(path, line) print("Added the following to " + path) for line in sauce: print("\t" + line)
def add_drive_to_config(remote_connection, remote_mount_point, local_mount_point): """ Adds a new network drive to the default mount config file """ module.append_file(MOUNT_FILE, remote_connection) module.append_file(MOUNT_FILE, remote_mount_point) module.append_file(MOUNT_FILE, local_mount_point)