modifié: m/loadConf.py
modifié: test/testFichier.py
This commit is contained in:
parent
2aa9f13d8d
commit
6082c35a0f
18
m/file/conf
18
m/file/conf
@ -1,9 +1,9 @@
|
||||
blind=1
|
||||
camera=192.168.1.13
|
||||
portCamera=80
|
||||
idUrlCamera=test:a
|
||||
endUrlCamera=/image.jpg
|
||||
serv=127.0.0.1
|
||||
portServ=80
|
||||
ipDomoMi=127.0.0.1
|
||||
portDomoMi=8080
|
||||
blind 1
|
||||
camera 192.168.1.13
|
||||
portCamera 80
|
||||
idUrlCamera test:a
|
||||
endUrlCamera /image.jpg
|
||||
serv 127.0.0.1
|
||||
portServ 80
|
||||
ipDomoMi 127.0.0.1
|
||||
portDomoMi 8080
|
||||
|
@ -14,7 +14,7 @@ class LoadConf(object):
|
||||
"""
|
||||
with open(self.path , "r") as source :
|
||||
for ligne in source:
|
||||
data = ligne.rstrip('\r\n').split('=')
|
||||
data = ligne.rstrip('\r\n').split(' ')
|
||||
if data[0] == key :
|
||||
source.close()
|
||||
return data[1]
|
||||
|
@ -27,7 +27,7 @@ class testConf(object):
|
||||
key=''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(random.randint(1,20)))
|
||||
value = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(random.randint(1,20)))
|
||||
self.assos[i] = [key,value]
|
||||
f.write(key+"="+value+"\n")
|
||||
f.write(key+" "+value+"\n")
|
||||
f.close()
|
||||
print "Random Conf File Create"
|
||||
|
||||
|
Reference in New Issue
Block a user