From ef65a91086771d01ed48d2518261469922461a86 Mon Sep 17 00:00:00 2001 From: TheBidouilleur Date: Sat, 31 Oct 2020 00:06:51 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'generate=5Fconfig.?= =?UTF-8?q?py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generate_config.py | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/generate_config.py b/generate_config.py index d448f9b..7f75172 100644 --- a/generate_config.py +++ b/generate_config.py @@ -26,39 +26,40 @@ def series(): print("Le fichier watched_series.json a bien ete cree") def config(): - print("Configuration du fichier user_config.json") - print(sys.argv()) + + print("Configuration du fichier user_config.json") + print(sys.argv()) - if len(sys.argv) != 7 : - print("Il n'y a pas le bon nombre d'argument") - sys.exit() + if len(sys.argv) != 7 : + print("Il n'y a pas le bon nombre d'argument") + sys.exit() - client_id = sys.argv[2] - login = sys.argv[3] - password = sys.argv[4] - user_id = sys.argv[5] - token_bot = sys.argv[6] + client_id = sys.argv[2] + login = sys.argv[3] + password = sys.argv[4] + user_id = sys.argv[5] + token_bot = sys.argv[6] - if path.exists('user_config.json') == False : - print("Le fichier user_config.json n'existe pas") - else : - print("Le fichier user_config existe.. On le supprime") - os.remove('user_config.json') + if path.exists('user_config.json') == False : + print("Le fichier user_config.json n'existe pas") + else : + print("Le fichier user_config existe.. On le supprime") + os.remove('user_config.json') - config = {"client_id" : client_id, + config = {"client_id" : client_id, "login" : login, "password" : password, "user_id" : user_id, "token_bot" : token_bot} - print("Dictionnaire de la configuration", config) + print("Dictionnaire de la configuration", config) - with open('user_config.json', 'w') as json_file: - config = json.dump(config, json_file) + with open('user_config.json', 'w') as json_file: + config = json.dump(config, json_file) - print("Le fichier user_config a bien ete cree") - return + print("Le fichier user_config a bien ete cree") + return if len(sys.argv) == 1 :