Add shuffle select instance

This commit is contained in:
localhost_frssoft 2023-06-26 22:38:57 +03:00
parent 8d441fb84a
commit c949f9fde2

View File

@ -117,7 +117,8 @@ def instances_menu(fetch_manually=False, fetch_node_info=False):
map_in_extend_mode = '\nmap: instance | anonymousCanListen | tracks'
instance_menu_selector = ['Fetch new instances',
'Fetch nodeinfo and avalaibility',
'Remove unreachible instances']
'Remove unreachible instances',
'Shuffle']
instance = fzf.prompt(
instance_menu_selector +
@ -131,6 +132,9 @@ def instances_menu(fetch_manually=False, fetch_node_info=False):
return instances_menu(fetch_manually=True)
if instance == 'Fetch nodeinfo and avalaibility':
return instances_menu(fetch_node_info=True)
if instance == 'Shuffle':
import random
instance = random.choice(list(list_instances.keys()))
if instance == 'Remove unreachible instances':
clean_unreach = {}
for ins, info in list_instances.items():