From 808e94a8ac468b12a5e5b4a92ad9568b4881ada3 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Thu, 29 Jun 2023 00:02:18 +0300 Subject: [PATCH] Add new instance via menu --- src/fw_instances.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fw_instances.py b/src/fw_instances.py index b1faded..2fd1d65 100644 --- a/src/fw_instances.py +++ b/src/fw_instances.py @@ -115,7 +115,8 @@ def instances_menu(fetch_manually=False, fetch_node_info=False): list_instances = fetch_instances_nodeinfo_and_avalaibility([instance.split('|')[0].strip() for instance in list_instances.keys()]) settings.set_config('public_list_instances_extended', list_instances) map_in_extend_mode = '\nmap: instance | anonymousCanListen | tracks' - instance_menu_selector = ['Fetch new instances', + instance_menu_selector = ['Add new instance', + 'Fetch new instances', 'Fetch nodeinfo and avalaibility', 'Remove unreachible instances', 'Shuffle'] @@ -128,6 +129,11 @@ def instances_menu(fetch_manually=False, fetch_node_info=False): return else: instance = instance[0].split('|')[0].strip() + if instance == 'Add new instance': + new = input('example.com\n').strip() + list_instances[new] = 'added by user' + settings.set_config('public_list_instances_extended', list_instances) + instance = new if instance == 'Fetch new instances': return instances_menu(fetch_manually=True) if instance == 'Fetch nodeinfo and avalaibility':