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.
|
# Creates new server dicts in the server array.
|
||||||
def create_server():
|
def create_server():
|
||||||
global servers
|
global servers # Global so that we can write to it.
|
||||||
print('\n=== Add Server ===')
|
print('\n=== Add Server ===')
|
||||||
srv_name = input('Name: ')
|
srv_name = input('Name: ')
|
||||||
srv_addr = input('Address: ')
|
srv_addr = input('Address: ')
|
||||||
srv_port = input('Port: ')
|
srv_port = input('Port: ')
|
||||||
srv_pass = input('Password: ')
|
srv_pass = input('Password: ')
|
||||||
print('OK\n')
|
print('OK\n')
|
||||||
new_server = [{"name":srv_name,"address":srv_addr,"port":srv_port,"password":srv_pass}]
|
new_server = [{"name":srv_name,"address":srv_addr,"port":srv_port,"password":srv_pass}] # Build new dict in array.
|
||||||
servers = servers + new_server
|
servers = servers + new_server # Append new array to existing array.
|
||||||
write_servers()
|
write_servers() # Write to the file.
|
||||||
initial_choice()
|
|
||||||
|
|
||||||
def pop_server():
|
def pop_server():
|
||||||
global servers
|
global servers
|
||||||
|
@ -106,6 +105,7 @@ def initial_choice():
|
||||||
match choose_func:
|
match choose_func:
|
||||||
case "1":
|
case "1":
|
||||||
create_server()
|
create_server()
|
||||||
|
initial_choice()
|
||||||
case "2":
|
case "2":
|
||||||
pop_server()
|
pop_server()
|
||||||
case "3":
|
case "3":
|
||||||
|
|
Loading…
Reference in a new issue