ajout de la doc pydoc
darcs-hash:20061123200724-f46e9-fdd14a07b448b323145a69bae0d9c66a3eb54f71.gz
This commit is contained in:
parent
e8132317e8
commit
d37a454b53
5 changed files with 165 additions and 32 deletions
|
@ -1,12 +1,20 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: iso-8859-15 -*-
|
||||
"""
|
||||
etat_imprimante.py
|
||||
|
||||
Récupère, filtre et formate l'état actuel de l'imprimante
|
||||
|
||||
Copyright (c) 2006 by www.crans.org
|
||||
|
||||
"""
|
||||
|
||||
import sys
|
||||
sys.path.append("/usr/scripts/gestion")
|
||||
|
||||
import hptools
|
||||
|
||||
dico = {
|
||||
_dico = {
|
||||
u"PrÁt": u"Prêt",
|
||||
u"Pr menus, appuy \x1e": u"",
|
||||
u"Powersave activÅ": u"En veille",
|
||||
|
@ -27,6 +35,7 @@ dico = {
|
|||
}
|
||||
|
||||
class ErreurCommunication(Exception):
|
||||
"""Si une erreur est survenue lors de la communication avec l'imprimante"""
|
||||
pass
|
||||
|
||||
def etat():
|
||||
|
@ -37,7 +46,7 @@ def etat():
|
|||
liste_msg = []
|
||||
for oid in liste_oid:
|
||||
msg = comm.get_string(oid).decode("ISO-8859-1")
|
||||
msg = dico.get(msg, msg)
|
||||
msg = _dico.get(msg, msg)
|
||||
if msg: liste_msg.append(msg)
|
||||
except Exception,err:
|
||||
raise ErreurCommunication, str(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue