[impression] maj de class_impression pour la nouvelele imprimante
Ignore-this: 5a2a03b33fa00ec84dca5fe353dd2659 darcs-hash:20090515105240-bd074-9d8f99c09b4c2f53110fa766e57ee1001205dcbb.gz
This commit is contained in:
parent
2e3f4a3239
commit
8c6816b511
3 changed files with 104 additions and 85 deletions
|
@ -5,25 +5,26 @@ import sys
|
|||
sys.path.append("/usr/scripts/gestion")
|
||||
|
||||
import hptools
|
||||
from config import impression
|
||||
|
||||
dico = {
|
||||
u"PrÁt": u"Prêt",
|
||||
u"Pr menus, appuy \x1e": u"",
|
||||
u"Powersave activÅ": u"En veille",
|
||||
u"Verification": u"Vérification imprimante",
|
||||
u"imprimante": u"",
|
||||
u"PrÅchauffage": u"Préchauffage",
|
||||
u"Traitement de la": u"Impression en cours",
|
||||
u"tÀche du bac 4": u"",
|
||||
u"tÀche du bac 3": u"",
|
||||
u"COMMANDER CARTOUCHE": u"",
|
||||
u"CYAN": u"",
|
||||
u"MAGENTA": u"",
|
||||
}
|
||||
|
||||
def etat():
|
||||
def etat_laserjet():
|
||||
""" Renvoie une liste des differents ecrans actuels du display de l'imprimante """
|
||||
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"]
|
||||
dico = {
|
||||
u"PrÁt": u"Prêt",
|
||||
u"Pr menus, appuy \x1e": u"",
|
||||
u"Powersave activÅ": u"En veille",
|
||||
u"Verification": u"Vérification imprimante",
|
||||
u"imprimante": u"",
|
||||
u"PrÅchauffage": u"Préchauffage",
|
||||
u"Traitement de la": u"Impression en cours",
|
||||
u"tÀche du bac 4": u"",
|
||||
u"tÀche du bac 3": u"",
|
||||
u"COMMANDER CARTOUCHE": u"",
|
||||
u"CYAN": u"",
|
||||
u"MAGENTA": u"",
|
||||
}
|
||||
|
||||
try:
|
||||
comm = hptools.snmp(host="laserjet.adm.crans.org",version="1",community="public")
|
||||
liste_msg = []
|
||||
|
@ -35,6 +36,21 @@ def etat():
|
|||
liste_msg.append("[%s]" % unicode(err))
|
||||
return liste_msg
|
||||
|
||||
def etat_canon():
|
||||
try:
|
||||
liste_msg = []
|
||||
comm = hptools.snmp(host="imprimante.adm.crans.org", version="1", community="public")
|
||||
for i 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))
|
||||
return liste_msg
|
||||
|
||||
def etat():
|
||||
exec ("etat_%()" % impression.imprimante)
|
||||
|
||||
def enregistre(filename="/usr/script/impression/imprimante.etat"):
|
||||
l = etat()
|
||||
fichier = open(filename,'w')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue