Enable multiple mirror selection #457 (#809)

Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
This commit is contained in:
Daniel 2022-01-01 01:36:05 +11:00 committed by GitHub
parent 7f9b7991e9
commit 638a05243c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -797,13 +797,15 @@ def select_mirror_regions():
:rtype: dict
"""
# TODO: Support multiple options and country codes, SE,UK for instance.
mirrors = list_mirrors()
selected_mirror = Menu('Select one of the regions to download packages from', mirrors.keys()).run()
selected_mirror = Menu(
'Select one of the regions to download packages from',
mirrors.keys(),
multi=True
).run()
if selected_mirror is not None:
return {selected_mirror: mirrors[selected_mirror]}
return {selected: mirrors[selected] for selected in selected_mirror}
return {}