From 7031a76b06869301df41652a7b157bf8171f711d Mon Sep 17 00:00:00 2001 From: Milka64 Date: Sat, 30 Jan 2021 21:35:52 +0100 Subject: [PATCH] fix boulette --- kabot/kabot/kabot.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index 1fd108d..43ca715 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -557,16 +557,18 @@ def main(): ) args = parser.parse_args() config = configparser.ConfigParser() + if not os.path.exists(args.config): + logger.critical('config file not found') + exit(1) + config.read(args.config) + log_file = config['DEFAULT']['logs'] ## definition du fichier de log (chemin, level, etc ...) file_handler = RotatingFileHandler(log_file, 'a', 1000000, 1) file_handler.setLevel(logging.INFO) file_handler.setFormatter(formatter) logger.addHandler(file_handler) - if not os.path.exists(args.config): - logger.critical('config file not found') - exit(1) - config.read(args.config) + if "nickname" in config['DEFAULT']: nickname = config['DEFAULT']['nickname'] else: