From b882d0deba88ff71516f15dbe5401e4d148ca5e4 Mon Sep 17 00:00:00 2001 From: piair338 Date: Sun, 16 Oct 2022 13:20:57 +0000 Subject: [PATCH] oui --- main.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 4fb47f5..edfd68b 100644 --- a/main.py +++ b/main.py @@ -4,13 +4,20 @@ import configparser import os import shutil -default_config = f"{os.path.abspath( os.path.dirname( __file__ ) )}/user_data/config.default" -new = f"{os.path.abspath( os.path.dirname( __file__ ) )}/user_data/config.cfg" -shutil.copyfile(default_config, config_path) - config = configparser.ConfigParser() config.read(config_path) +try : + config_path = f"{os.path.abspath( os.path.dirname( __file__ ) )}/user_data/config.cfg" + config.read(config_path) +except : + default_config = f"{os.path.abspath( os.path.dirname( __file__ ) )}/user_data/config.default" + shutil.copyfile(default_config, config_path) + config.read(config_path) + + + + def confirm(texte, default = False): if default : txt = '[Y/n]'