mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[utils] Change wording of SDL prompt, support space-separated list
This commit is contained in:
parent
f22c8d0ab6
commit
55f9f05206
|
@ -18,20 +18,21 @@ def sdl_prompt(sdl_data, title):
|
||||||
if '__required' in sdl_data:
|
if '__required' in sdl_data:
|
||||||
tags.extend(sdl_data['__required']['tags'])
|
tags.extend(sdl_data['__required']['tags'])
|
||||||
|
|
||||||
print(f'You are about to install {title}, this game supports selective downloads.')
|
print(f'You are about to install {title}, this application supports selective downloads.')
|
||||||
print('The following optional packs are available:')
|
print('The following optional packs are available (tag - name):')
|
||||||
for tag, info in sdl_data.items():
|
for tag, info in sdl_data.items():
|
||||||
if tag == '__required':
|
if tag == '__required':
|
||||||
continue
|
continue
|
||||||
print(' *', tag, '-', info['name'])
|
print(' *', tag, '-', info['name'])
|
||||||
|
|
||||||
print('Please enter a comma-separated list of optional packs to install (leave blank for defaults)')
|
|
||||||
examples = ', '.join([g for g in sdl_data.keys() if g != '__required'][:2])
|
examples = ', '.join([g for g in sdl_data.keys() if g != '__required'][:2])
|
||||||
choices = input(f'Additional packs [e.g. {examples}]: ')
|
print(f'Please enter tags of pack(s) to install (space/comma-separated, e.g. "{examples}")')
|
||||||
|
print('Leave blank to use defaults (only required data will be downloaded).')
|
||||||
|
choices = input(f'Additional packs [Enter to confirm]: ')
|
||||||
if not choices:
|
if not choices:
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
for c in choices.split(','):
|
for c in choices.strip('"').replace(',', ' ').split():
|
||||||
c = c.strip()
|
c = c.strip()
|
||||||
if c in sdl_data:
|
if c in sdl_data:
|
||||||
tags.extend(sdl_data[c]['tags'])
|
tags.extend(sdl_data[c]['tags'])
|
||||||
|
|
Loading…
Reference in a new issue