[impression/etat_imprimante] on récupère les erreurs
Ignore-this: bf6a4fe45c27c277e41339ae7832f62e darcs-hash:20090526122337-bd074-139ca0919ddda2fec79dcc7e938f56a0bba7c525.gz
This commit is contained in:
parent
945c02bd73
commit
7da73d50e6
1 changed files with 13 additions and 10 deletions
|
@ -30,22 +30,25 @@ def etat_canon():
|
|||
'other(1)\ndown(5)' : u"Imprimante hors-service",
|
||||
'other(1)\nrunning(2)' : u'Imprimante en veille',
|
||||
'warmup(5)\nrunning(2)' : u'Préchauffage',
|
||||
'idle(3)\nwarning(3)' : u"""Imprimante fonctionnelle
|
||||
(penser à vérifier le niveau d'encre et de papier)""",
|
||||
'printing(4)\nwarning(3)' : u"""Impression en cours
|
||||
(penser à vérifier le niveau d'encre et de papier)""",
|
||||
'idle(3)\nwarning(3)' : u'Imprimante fonctionnelle',
|
||||
'printing(4)\nwarning(3)' : u'Impression en cours'
|
||||
}
|
||||
try:
|
||||
msg = liste_msg = []
|
||||
raw_msg = msg = []
|
||||
comm = snmp(host="imprimante.adm.crans.org", version="1", community="public")
|
||||
|
||||
for oid in [".hrPrinterStatus.1", ".hrDeviceStatus.1"]:
|
||||
#".hrPrinterDetectedErrorState.1"
|
||||
msg.append(comm.get_string(oid))
|
||||
liste_msg = _dico['\n'.join(msg)].split('\n')
|
||||
except Exception,err:
|
||||
liste_msg.append("[%s]" % unicode(err))
|
||||
raw_msg.append(comm.get_string(oid))
|
||||
msg = _dico['\n'.join(msg)].split('\n')
|
||||
|
||||
return liste_msg
|
||||
if raw_msg[1] == 'warning(3)':
|
||||
msg += (comm.walk('mib-2.43.18.1.1.8').values()
|
||||
|
||||
except Exception,err:
|
||||
msg.append("[%s]" % unicode(err))
|
||||
|
||||
return msg
|
||||
|
||||
def etat_laserjet():
|
||||
""" Renvoie une liste des differents ecrans actuels du display de l'imprimante """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue