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]'