oui
This commit is contained in:
parent
ae3a89802b
commit
b882d0deba
15
main.py
15
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]'
|
||||
|
|
Loading…
Reference in New Issue