[lib/impression] correction de bugs divers (pour la plupart de syntaxe ou de mauvais nom)
Ignore-this: b8259d81c6f15949baf5a5c77bad0a4e darcs-hash:20090516014507-bd074-49f74e30e18d7d705bb8b11400a4fec514e71358.gz
This commit is contained in:
parent
d87c41e637
commit
c9a25af79f
2 changed files with 38 additions and 37 deletions
|
@ -20,15 +20,14 @@ class ErreurCommunication(Exception):
|
|||
pass
|
||||
|
||||
def etat():
|
||||
exec ("etat_%()" % impression.imprimante)
|
||||
exec ("etat_%s()" % impression.imprimante)
|
||||
|
||||
def etat_canon():
|
||||
try:
|
||||
liste_msg = []
|
||||
comm = hptools.snmp(host="imprimante.adm.crans.org", version="1", community="public")
|
||||
comm = snmp(host="imprimante.adm.crans.org", version="1", community="public")
|
||||
for oid in [".hrPrinterStatus.1", ".hrPrinterDetectedErrorState.1"]:
|
||||
msg = comm.get_string(oid)
|
||||
msg = dico.get(msg, msg)
|
||||
if msg: liste_msg.append(msg)
|
||||
except Exception,err:
|
||||
liste_msg.append("[%s]" % unicode(err))
|
||||
|
@ -64,7 +63,7 @@ def etat_laserjet():
|
|||
|
||||
liste_oid = ["mib-2.43.16.5.1.2.1.1","mib-2.43.16.5.1.2.1.2","mib-2.43.16.5.1.2.1.3","mib-2.43.16.5.1.2.1.4","mib-2.43.16.5.1.2.1.5"]
|
||||
try:
|
||||
comm = hptools.snmp(host="laserjet.adm.crans.org",version="1",community="public")
|
||||
comm = snmp(host="laserjet.adm.crans.org",version="1",community="public")
|
||||
liste_msg = []
|
||||
for oid in liste_oid:
|
||||
msg = comm.get_string(oid).decode("ISO-8859-1")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue