From c949f9fde27998e6d20c29dcca6f5fe92a222301 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Mon, 26 Jun 2023 22:38:57 +0300 Subject: [PATCH] Add shuffle select instance --- src/fw_instances.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fw_instances.py b/src/fw_instances.py index 8c7521f..e651abf 100644 --- a/src/fw_instances.py +++ b/src/fw_instances.py @@ -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():