From 8ec78fd01b4a07dd6f91e1a29c6d39b9d5684119 Mon Sep 17 00:00:00 2001 From: Subnet_Masked Date: Sun, 4 Feb 2024 16:55:49 -0500 Subject: [PATCH] more comments, remove unnecessary function call. --- mc_control.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mc_control.py b/mc_control.py index f503b7b..7d338f4 100644 --- a/mc_control.py +++ b/mc_control.py @@ -44,17 +44,16 @@ def list_servers(mode=int(1)): # make sure a default is set. # Creates new server dicts in the server array. def create_server(): - global servers + global servers # Global so that we can write to it. print('\n=== Add Server ===') srv_name = input('Name: ') srv_addr = input('Address: ') srv_port = input('Port: ') srv_pass = input('Password: ') print('OK\n') - new_server = [{"name":srv_name,"address":srv_addr,"port":srv_port,"password":srv_pass}] - servers = servers + new_server - write_servers() - initial_choice() + new_server = [{"name":srv_name,"address":srv_addr,"port":srv_port,"password":srv_pass}] # Build new dict in array. + servers = servers + new_server # Append new array to existing array. + write_servers() # Write to the file. def pop_server(): global servers @@ -106,6 +105,7 @@ def initial_choice(): match choose_func: case "1": create_server() + initial_choice() case "2": pop_server() case "3":