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 :