more comments, remove unnecessary function call.
This commit is contained in:
parent
a87b03a589
commit
8ec78fd01b
1 changed files with 5 additions and 5 deletions
|
@ -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":
|
||||
|
|
Loading…
Reference in a new issue