diff options
| author | Debulois Quentin <quentin.debulois@gmail.com> | 2020-09-18 08:20:42 +0200 |
|---|---|---|
| committer | Debulois Quentin <quentin.debulois@gmail.com> | 2020-09-18 08:20:42 +0200 |
| commit | 1f04346cae63d14e47c2c4dfe6721b28a1e45211 (patch) | |
| tree | 7da1cf4a1cab01882bfc8497c3f929b35b3d81b9 /Redim/config.py | |
| parent | 738685e0ff2686e9be969ff29019663c6981d984 (diff) | |
POO en cour ui pour ce commmit
Diffstat (limited to 'Redim/config.py')
| -rw-r--r-- | Redim/config.py | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/Redim/config.py b/Redim/config.py index 9f3af98..4bfa31a 100644 --- a/Redim/config.py +++ b/Redim/config.py @@ -1,26 +1,16 @@ import json -from os.path import isdir, mkdir, join +from os import mkdir +from os.path import isdir, join class Config(): - def sauvegarde(json_path, largeur1, hauteur1, largeur2, hauteur2, background_color, format_final): - dictionnaire = { - "dimensions": [[largeur1, hauteur1], [largeur2, hauteur2]], - "background_color": background_color, - "format_final": format_final - } + def sauvegarde(self, json_path, configuration): if not isdir(json_path): mkdir(json_path) with open(join(json_path, "config_redim"), "w") as f: - json.dump(dictionnaire, f) + json.dump(configuration, f) - def lecture(json_path): + def lecture(self, json_path): with open(join(json_path, "config_redim"), "r") as f: - dictionnaire = json.load(f) - largeur1 = dictionnaire["dimensions"][0][0] - hauteur1 = dictionnaire["dimensions"][0][1] - largeur2 = dictionnaire["dimensions"][1][0] - hauteur2 = dictionnaire["dimensions"][1][1] - background_color = dictionnaire["background_color"] - format_final = dictionnaire["format_final"] - return largeur1, hauteur1, largeur2, hauteur2, background_color, format_final + configuration = json.load(f) + return configuration |
