Мелкие правки
This commit is contained in:
parent
3e8497db2d
commit
343c21499e
19
dodo.py
19
dodo.py
@ -24,7 +24,7 @@ if x>0:
|
|||||||
|
|
||||||
|
|
||||||
def print_line(text):
|
def print_line(text):
|
||||||
"Добавление тире вокруг текста, потом сюда можно поместить и расскраску текста"
|
"Добавление тире вокруг текста, покраска"
|
||||||
print(colorama.Fore.YELLOW + "-"*25)
|
print(colorama.Fore.YELLOW + "-"*25)
|
||||||
print(colorama.Fore.GREEN + text)
|
print(colorama.Fore.GREEN + text)
|
||||||
print(colorama.Fore.YELLOW + "-"*25 + colorama.Style.RESET_ALL)
|
print(colorama.Fore.YELLOW + "-"*25 + colorama.Style.RESET_ALL)
|
||||||
@ -58,7 +58,7 @@ create_dir(config_dodo)
|
|||||||
@dodo.command()
|
@dodo.command()
|
||||||
def config(map_server=list_config):
|
def config(map_server=list_config):
|
||||||
query_p = []
|
query_p = []
|
||||||
port_s = []
|
port_s = []
|
||||||
for i in map_server:
|
for i in map_server:
|
||||||
with open(f"{home_dir}/.config/dodo/{i}", "r") as yamlfile:
|
with open(f"{home_dir}/.config/dodo/{i}", "r") as yamlfile:
|
||||||
data = yaml.load(yamlfile, Loader=yaml.FullLoader)
|
data = yaml.load(yamlfile, Loader=yaml.FullLoader)
|
||||||
@ -66,25 +66,22 @@ def config(map_server=list_config):
|
|||||||
port_s.append(data['Port'])
|
port_s.append(data['Port'])
|
||||||
query_p.append(data['QueryPort'])
|
query_p.append(data['QueryPort'])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cluster_dir_override = ""
|
cluster_dir_override = ""
|
||||||
cluster_id = ""
|
cluster_id = ""
|
||||||
count_cluster = check_int("""Укажите требуется ли кластер?
|
count_cluster = check_int("""Укажите требуется ли кластер?
|
||||||
1. Да
|
1. Да
|
||||||
2. Нет
|
2. Нет
|
||||||
: """)
|
: """)
|
||||||
if count_cluster == 0:
|
if count_cluster == 0: # 0 возвращает функция chek_int, если ничего не было введено
|
||||||
count_cluster = 2
|
count_cluster = 2
|
||||||
if count_cluster == 1:
|
if count_cluster == 1:
|
||||||
cluster_server = True
|
cluster_server = True
|
||||||
else:
|
|
||||||
cluster_server = False
|
|
||||||
|
|
||||||
if cluster_server == True:
|
|
||||||
cluster_id = input("Укажите id для кластера, любое сочетание символов: \n")
|
cluster_id = input("Укажите id для кластера, любое сочетание символов: \n")
|
||||||
create_dir(dir_server + cluster_id)
|
create_dir(dir_server + cluster_id)
|
||||||
cluster_dir_override = (dir_server + cluster_id)
|
cluster_dir_override = (dir_server + cluster_id)
|
||||||
|
else:
|
||||||
|
cluster_server = False
|
||||||
|
|
||||||
|
|
||||||
if map_server != []:
|
if map_server != []:
|
||||||
print("Уже установленные карты: ")
|
print("Уже установленные карты: ")
|
||||||
@ -92,7 +89,7 @@ def config(map_server=list_config):
|
|||||||
print(i)
|
print(i)
|
||||||
|
|
||||||
count_maps = check_int("Укажите количество карт: \n")
|
count_maps = check_int("Укажите количество карт: \n")
|
||||||
if count_maps == 0:
|
if count_maps == 0: # 0 возрвращает check_int когда, ничего не было введено
|
||||||
count_maps = 1
|
count_maps = 1
|
||||||
for i in range(count_maps):
|
for i in range(count_maps):
|
||||||
while True:
|
while True:
|
||||||
@ -112,7 +109,7 @@ def config(map_server=list_config):
|
|||||||
11. Lost Island
|
11. Lost Island
|
||||||
12. Fjordur
|
12. Fjordur
|
||||||
: """)
|
: """)
|
||||||
if amount_map == 0:
|
if amount_map == 0: # 0 возрвращает check_int когда, ничего не было введено
|
||||||
amount_map = i + 1
|
amount_map = i + 1
|
||||||
if 0<amount_map<=12:
|
if 0<amount_map<=12:
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user