-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActivites.py
More file actions
32 lines (31 loc) · 970 Bytes
/
Activites.py
File metadata and controls
32 lines (31 loc) · 970 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
25
26
27
28
29
30
31
32
class Activites :
def __init__(self,ComInsee,ComLib,EquipementId,ActCode) :
self.ComInsee=ComInsee;
self.ComLib=ComLib;
self.EquipementId=EquipementId;
self.ActCode=ActCode;
def getComInsee(self) :
return self.ComInsee;
def getComLib(self) :
return self.ComLib;
def getEquipementId(self) :
return self.EquipementId;
def getActCode(self) :
return self.ActCode;
def setComInsee(self,c) :
self.ComInsee=c;
def setComLib(self,c) :
self.ComLib=c;
def setEquipementId(self,c) :
self.EquipementId=c;
def setActCode(self,c) :
self.ActCode=c;
def SQLInsert(self,dbName) :
return "INSERT INTO {0} VALUES ('{1}','{2}','{3}','{4}')".format(dbName,self.ComInsee,self.ComLib,self.EquipementId,self.ActCode)
def loadJsonFile() :
json_file = "BD/Activites.json"
tab=[]
file_data = json.load(open(json_file))
for item in file_data["data"]:
tab.append(Activites(item["ComInsee"],item["ComLib"],item["EquipementId"],item["ActCode"]))
return tab