def securityDataMessage() -> bool: print('\n' + translate.getValue('FILES_MENU.ALERT_MESSAGE')) menuOptions = [ translate.getValue('FILES_MENU.NO'), translate.getValue('FILES_MENU.YES') ] common.printMenu(menuOptions) selectedOption = common.requestOptionInteger(0, len(menuOptions)) return False if selectedOption == 0 else True
def saveLocalData() -> None: files: [str] = getListDir('system_data/save_files') print('\n' + translate.getValue('FILES_MENU.SAVE_DATA_MESSAGE')) optionsMenu = [translate.getValue('FILES_MENU.NEW_SLOT')] + files common.printMenu(optionsMenu) selectedOption = common.requestOptionInteger(0, len(optionsMenu)) if selectedOption == 0: saveData(requestSaveName()) else: resetData('system_data/save_files/' + optionsMenu[selectedOption]) saveData(optionsMenu[selectedOption])
def deleteLocalData() -> None: files: [str] = getListDir('system_data/save_files') if len(files) > 0: print('\n' + translate.getValue('FILES_MENU.DELETE_DATA_MESSAGE')) common.printMenu(files, False) selectedOption = common.requestOptionInteger(0, len(files)) if securityDataMessage(): resetData('system_data/save_files/' + files[selectedOption]) print('\n' + translate.getValue('FILES_MENU.DELETE_DATA_COMPLETE')) else: print('\n' + translate.getValue('FILES_MENU.DATA_NOT_FOUND'))
def openMenu() -> None: menuOptions = [ translate.getValue('SETTING_MENU.EXIT'), translate.getValue('SETTING_MENU.CHANGE_LANGUAGE') ] common.printMenu(menuOptions) selectedOption = common.requestOptionInteger(0, len(menuOptions)) if selectedOption != 0: if selectedOption == 1: newLanguage = translate.openMenu() if len(newLanguage) > 0: setLanguage(newLanguage) openMenu()
def openMenu() -> None: menuOptions = [ translate.getValue('LAUNCHS_MENU.EXIT'), translate.getValue('LAUNCHS_MENU.NEW_LAUNCH'), translate.getValue('LAUNCHS_MENU.SEE_LAUNCHS') ] common.printMenu(menuOptions) selectedOption = common.requestOptionInteger(0, len(menuOptions)) if selectedOption != 0: if selectedOption == 1: addNewLaunch() elif selectedOption == 2: printLaunchsList() openMenu()
def openMenu() -> None: menuOptions = [ translate.getValue('TYPES_ROCKETS_MENU.EXIT'), translate.getValue('TYPES_ROCKETS_MENU.NEW_ROCKET'), translate.getValue('TYPES_ROCKETS_MENU.SEE_ROCKETS') ] common.printMenu(menuOptions) selectedOption = common.requestOptionInteger(0, len(menuOptions)) if selectedOption != 0: if selectedOption == 1: addNewRocket() elif selectedOption == 2: printRocketsList() openMenu()
def openMenu() -> str: menuOptions = [ getValue('SETTING_MENU.EXIT'), getValue('COMMON.LANGUAGES.ES'), getValue('COMMON.LANGUAGES.EN') ] common.printMenu(menuOptions) selectedOption = common.requestOptionInteger(0, len(menuOptions)) if selectedOption != 0: if selectedOption == 1: loadProperties('es') return 'es' file.writeFile() elif selectedOption == 2: loadProperties('en') return 'en' else: return ''
def openMenu() -> None: menuOptions = [ translate.getValue('FILES_MENU.EXIT'), translate.getValue('FILES_MENU.LOAD_DATA'), translate.getValue('FILES_MENU.SAVE_DATA'), translate.getValue('FILES_MENU.RESET_DATA'), translate.getValue('FILES_MENU.DELETE_DATA') ] common.printMenu(menuOptions) selectedOption = common.requestOptionInteger(0, len(menuOptions)) if selectedOption != 0: if selectedOption == 1: loadLocalData() elif selectedOption == 2: saveLocalData() elif selectedOption == 3: resetLocalData() elif selectedOption == 4: deleteLocalData() openMenu()
def openMenu() -> None: print("\n" + translate.getValue('MAIN_MENU.TODAY') + ": " + str(configuration.getDay())) menuOptions = [ translate.getValue('MAIN_MENU.EXIT'), translate.getValue('MAIN_MENU.TYPES_OF_ROCKETS'), translate.getValue('MAIN_MENU.STATION_REQUESTS'), translate.getValue('MAIN_MENU.RELEASES_AVAILABLE'), translate.getValue('MAIN_MENU.ASSIGN'), translate.getValue('MAIN_MENU.DAYS'), translate.getValue('MAIN_MENU.ADVANCED_INFORMATION'), translate.getValue('MAIN_MENU.SETTING'), translate.getValue('MAIN_MENU.FILES') ] common.printMenu(menuOptions) selectedOption = common.requestOptionInteger(0, len(menuOptions)) if selectedOption != 0: if selectedOption == 1: types_rockets.openMenu() elif selectedOption == 2: station_requests.openMenu() elif selectedOption == 3: launchs.openMenu() elif selectedOption == 4: launchs.assignRequestsToLaunchs() elif selectedOption == 5: configuration.incrementDays() elif selectedOption == 6: advanced_information.openMenu() elif selectedOption == 7: configuration.openMenu() elif selectedOption == 8: files.openMenu() openMenu() else: print(translate.getValue('COMMON.EXIT'))
def getTypeRocket() -> Rocket: print(translate.getValue('TYPES_ROCKETS_MENU.GET_ROCKET_TYPE') + ": ") menuOptions = list(map(lambda rocket: rocket.getId() + ": " + str(rocket.getShipload()/1000) + " Kg", getRockets())) common.printMenu(menuOptions, False) selectedOption = common.requestOptionInteger(0, len(menuOptions)) return getRockets()[selectedOption]