-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstallations.py
More file actions
33 lines (31 loc) · 1.04 KB
/
Installations.py
File metadata and controls
33 lines (31 loc) · 1.04 KB
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
33
class Installations :
def __init__ (self,InsNumeroInstall,ComLib,ComInsee,InsCodePostal) :
self.InsNumeroInstall=InsNumeroInstall;
self.ComLib=ComLib;
self.ComInsee=ComInsee;
self.InsCodePostal=InsCodePostal;
def getInsNumeroInstall(self) :
return self.InsNumeroInstall
def getComLib(self) :
return self.ComLib
def getComInsee(self) :
return self.ComInsee
def getInsCodePostal(self) :
return self.InsCodePostal;
def setInsNumeroInstall(self,c) :
self.InsNumeroInstall=c
def setComLib(self,c) :
self.ComLib=c
def setComInsee(self,c) :
self.ComInsee=c
def setInsCodePostal(self,c) :
self.InsCodePostal=c
def SQLInsert(self,dbName) :
return "INSERT INTO {0} VALUES ('{1}','{2}','{3}','{4}')".format(dbName,self.InsNumeroInstall,self.ComLib,self.ComInsee,self.InsCodePostal)
def loadJsonFile() :
json_file = "BD/Installations.json"
tab=[]
file_data = json.load(open(json_file))
for item in file_data["data"]:
tab.append(Installations(item["InsNumeroInstall"],item["ComLib"],item["ComInsee"],item["InsCodePostal"]))
return tab