def selection_process(input): # Load up player file file_path = "./Players/" + __builtin__.active_user + ".data" with open(file_path) as player_data: player_json = json.load(player_data) player_ship_list = player_json[__builtin__.active_user]["ship_list"] if input == "info": id = raw_input("\nPlease enter the ID number of the ship:\n") if int(id) in player_ship_list: info_generator(id) sys.stdout.write("\n") selection = raw_input("Info | Back | Exit".center(80) + "\n\n" + prompt(__builtin__.active_user)) if selection.lower() == "back": os.system('clear') roster_view(__builtin__.active_user) else: selection_process(selection) else: if id in ship_json: print "You do not command that ship.\n" selection_process(input) else: print "That vessel does not exist.\n" selection_process(input) elif input == "back": ship_hanger.ship_hanger() else: command_process(input) print "Invalid Selection." selection = raw_input("Info | Back | Exit".center(80) + "\n\n" + prompt(__builtin__.active_user)) selection_process(selection)
def selection_process(): selection = raw_input(prompt(__builtin__.active_user)) # Check for exit/back commands command_process(selection) selection = selection.lower() if selection == "ship hanger": f = open('./Data/ship_hanger.txt', 'w') f.close() ship_hanger() elif selection == "wormholes": wormholes_view() elif selection == "salvage missions": salvage_missions() elif selection == "communications": communications() else: print "Invalid Selection" selection_process()