-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.py
More file actions
24 lines (22 loc) · 823 Bytes
/
Config.py
File metadata and controls
24 lines (22 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from Constants import *
class Config:
@classmethod
def readConfig(cls):
fichier = open("./config/color.cfg", "r")
config_color = fichier.read().splitlines() # va lire le fichier,de couleur
fichier.close()
cfg_color = (int(config_color[0]), int(config_color[1]), int(config_color[2]))
Constants.bg_color = cfg_color
return cfg_color
@classmethod
def setConfig(cls, new_color):
fichier = open("./config/color.cfg", "w")
try:
fichier.write(str(new_color[0]) + "\n")
fichier.write(str(new_color[1]) + "\n")
fichier.write(str(new_color[2]) + "\n")
except:
fichier.write("0\n")
fichier.write("0\n")
fichier.write("0\n")
fichier.close()