MCPcopy
hub / github.com/legendary-gl/legendary / get_boolean_choice

Function get_boolean_choice

legendary/utils/cli.py:1–10  ·  view source on GitHub ↗
(prompt, default=True)

Source from the content-addressed store, hash-verified

1def get_boolean_choice(prompt, default=True):
2 yn = 'Y/n' if default else 'y/N'
3
4 choice = input(f'{prompt} [{yn}]: ')
5 if not choice:
6 return default
7 elif choice[0].lower() == 'y':
8 return True
9 else:
10 return False
11
12
13def get_int_choice(prompt, default=None, min_choice=None, max_choice=None, return_on_invalid=False):

Callers 10

authMethod · 0.90
sync_savesMethod · 0.90
install_gameMethod · 0.90
uninstall_gameMethod · 0.90
_handle_uninstallerMethod · 0.90
import_gameMethod · 0.90
egs_syncMethod · 0.90
activateMethod · 0.90
manage_eos_overlayMethod · 0.90
crossover_setupMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected