From a87b03a5899c55c25f98f89ae21180afef313ec1 Mon Sep 17 00:00:00 2001 From: Subnet_Masked Date: Sun, 4 Feb 2024 16:52:21 -0500 Subject: [PATCH] Move code out of function into where it should be --- mc_control.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mc_control.py b/mc_control.py index 4b89488..f503b7b 100644 --- a/mc_control.py +++ b/mc_control.py @@ -14,7 +14,8 @@ def load_servers(): with open(servers_file,'r') as openfile: servers = json.load(openfile) else: - create_server(True) + print('\n!! Looks like you do not have any servers yet - Let\'s add one.\n') + create_server() # Write the contents to the servers variable to the servers_file. def write_servers(): @@ -42,11 +43,8 @@ def list_servers(mode=int(1)): # make sure a default is set. index += 1 # Creates new server dicts in the server array. -def create_server(isfirstrun=False): +def create_server(): global servers - if(isfirstrun): - print('\n!! Looks like you do not have any servers yet - Let\'s add one.\n') - print('\n=== Add Server ===') srv_name = input('Name: ') srv_addr = input('Address: ')