From b6470c1a73ebd2d1a04b1016804cac9cae97bc16 Mon Sep 17 00:00:00 2001 From: xpamych Date: Mon, 15 May 2023 20:44:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B2=D0=BE=D0=BD?= =?UTF-8?q?=D0=B0=D1=87=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=BC=20=D1=81=D0=BE?= =?UTF-8?q?=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D0=B8=20=D0=BA=D0=B0=D1=82=D0=B0?= =?UTF-8?q?=D0=BB=D0=BE=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hlna.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hlna.py b/hlna.py index a69cce8..ac131f6 100755 --- a/hlna.py +++ b/hlna.py @@ -35,6 +35,15 @@ list_config = find_file(dir_maps_ark) delist_config = find_file(dir_deactivated) +def create_dir(directory): + """Проверка и создание директории""" + if not os.path.exists(directory): + os.makedirs(directory) + + +create_dir(dir_config) + + def path_server(): """Получение пути для хранения файлов серверов, записываем путь в yaml файл""" dir_server = input(f"""Укажите путь до каталога, где будут храниться файлы сервера. По-умолчанию {home_dir}/Servers/ @@ -123,10 +132,7 @@ def unpack(src, dst): logging.info("Archive has been extracted.") -def create_dir(directory): - """Проверка и создание директории""" - if not os.path.exists(directory): - os.makedirs(directory) + def print_line(*text): @@ -806,7 +812,6 @@ date = now.strftime("%Y-%m-%d") time = now.strftime("%H:%M:%S") create_dir(dir_server) create_dir(dir_unit) -create_dir(dir_config) create_dir(dir_logs) if __name__ == '__main__':