This commit is contained in:
Евгений Храмов 2023-02-18 12:47:48 +03:00
parent 17b0cc8a17
commit e4efc42147

@ -17,17 +17,18 @@ config_dodo = f"{home_dir}/.config/dodo/"
mods_id = ""
listen_server = True
@click.group()
def dodo():
pass
list_config = next(os.walk(config_dodo), (None, None, []))[2] # [] if no file
x = list_config.count('.directory')
if x>0:
list_config.remove('.directory')
def logging(l):
"Записываем логи в файл"
with open(dir_server + "logs", "a") as filelog:
@ -53,8 +54,6 @@ def create_dir(directory):
logging(f"Не удалось создать директорию - {directory}")
def check_int(number=""):
"Проверка на ввод числа"
x=""
@ -107,7 +106,6 @@ def config(map_server=list_config):
else:
cluster_server = False
if map_server != []:
print("Уже установленные карты: ")
for i in map_server:
@ -232,6 +230,8 @@ def yaml_create(cluster_server, map_server, name_server, port_server, query_port
with open(config_dodo + f"{map_server[-1]}", 'w') as yamlfile:
data = yaml.dump(settings_dodo, yamlfile)
print(colorama.Fore.GREEN + "Конфиг создан" + colorama.Style.RESET_ALL)
@dodo.command()
def servers(map_servers=list_config):
if map_servers==[]: