Acrobatie pour ignorer le dcompte des pages restantes.

darcs-hash:20070223222052-68412-2969da806d5c774821355f3dc856f17ca39412c1.gz
This commit is contained in:
glondu 2007-02-23 23:20:52 +01:00
parent 78ee6db177
commit ce7a4cc4c7

View file

@ -23,6 +23,7 @@ dico = {
"JAUNE": 0,
"NOIR": 0,
'COMM TAMB. NOIR': 0,
'PAGES REST.': 0,
"": 0,
}
@ -33,7 +34,15 @@ def etat():
try:
comm = hptools.snmp(host="laserjet.adm.crans.org", version="1", community="public")
for oid in liste_oid:
total += dico.get(comm.get_string(oid), 4)
msg = comm.get_string(oid)
diff = dico.get(msg, None)
if diff == None:
for k in dico.keys():
if k in msg and k != "": diff = dico[k]
if diff == None:
diff = 4
total += diff
except Exception, err:
total += 24
return total