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