This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
DUT2PTUT/m/loadConf.py

26 lines
702 B
Python
Raw Normal View History

class LoadConf(object):
def loadValue(self, key):
2014-03-01 21:04:15 +00:00
with open("m/fichier/conf", "r") as source :
for ligne in source:
data = ligne.rstrip('\n\r').split('=')
if data[0] in key :
source.close()
2014-03-02 22:12:11 +00:00
return str(data[1])
source.close()
return "error"
def isBlind(self):
rep = self.loadValue("blind")
if rep == "1" :
return True
2014-03-02 22:04:55 +00:00
elif rep == "0":
return False
else :
return rep
2014-03-02 22:05:54 +00:00
def ipCamera(self) :
2014-03-02 22:12:11 +00:00
return str(self.loadValue("camera"))
2014-03-02 22:05:54 +00:00
def portServ(self) :
2014-03-02 22:12:11 +00:00
return str(self.loadValue("port"))