mirror of
http://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-24 03:21:27 +00:00
Add shuffle select instance
This commit is contained in:
parent
8d441fb84a
commit
c949f9fde2
|
@ -117,7 +117,8 @@ def instances_menu(fetch_manually=False, fetch_node_info=False):
|
||||||
map_in_extend_mode = '\nmap: instance | anonymousCanListen | tracks'
|
map_in_extend_mode = '\nmap: instance | anonymousCanListen | tracks'
|
||||||
instance_menu_selector = ['Fetch new instances',
|
instance_menu_selector = ['Fetch new instances',
|
||||||
'Fetch nodeinfo and avalaibility',
|
'Fetch nodeinfo and avalaibility',
|
||||||
'Remove unreachible instances']
|
'Remove unreachible instances',
|
||||||
|
'Shuffle']
|
||||||
|
|
||||||
instance = fzf.prompt(
|
instance = fzf.prompt(
|
||||||
instance_menu_selector +
|
instance_menu_selector +
|
||||||
|
@ -131,6 +132,9 @@ def instances_menu(fetch_manually=False, fetch_node_info=False):
|
||||||
return instances_menu(fetch_manually=True)
|
return instances_menu(fetch_manually=True)
|
||||||
if instance == 'Fetch nodeinfo and avalaibility':
|
if instance == 'Fetch nodeinfo and avalaibility':
|
||||||
return instances_menu(fetch_node_info=True)
|
return instances_menu(fetch_node_info=True)
|
||||||
|
if instance == 'Shuffle':
|
||||||
|
import random
|
||||||
|
instance = random.choice(list(list_instances.keys()))
|
||||||
if instance == 'Remove unreachible instances':
|
if instance == 'Remove unreachible instances':
|
||||||
clean_unreach = {}
|
clean_unreach = {}
|
||||||
for ins, info in list_instances.items():
|
for ins, info in list_instances.items():
|
||||||
|
|
Loading…
Reference in a new issue