ajout de l'ogs pour l'impression
darcs-hash:20070212081005-f46e9-1071e7f8da164a89e5c0db6abd4773a34744c4a2.gz
This commit is contained in:
parent
adc3ee2002
commit
ae9826de08
1 changed files with 9 additions and 2 deletions
|
@ -35,6 +35,8 @@ sys.path.append('/usr/scripts/gestion')
|
||||||
import config
|
import config
|
||||||
import cout
|
import cout
|
||||||
from crans.utils import QuoteForPOSIX as escapeForShell
|
from crans.utils import QuoteForPOSIX as escapeForShell
|
||||||
|
import crans.utils.logs
|
||||||
|
log = crans.utils.logs.getFileLogger('impression')
|
||||||
|
|
||||||
# ######################################################## #
|
# ######################################################## #
|
||||||
# CONSTANTES #
|
# CONSTANTES #
|
||||||
|
@ -395,6 +397,11 @@ class impression:
|
||||||
##
|
##
|
||||||
def _exec_imprime(self):
|
def _exec_imprime(self):
|
||||||
""" Envoie l'impression a l'imprimante avec les parametres actuels """
|
""" Envoie l'impression a l'imprimante avec les parametres actuels """
|
||||||
|
|
||||||
|
if (self._adh != None):
|
||||||
|
log.info('Impression [%s] : %s' % (self._adh, self._fichier))
|
||||||
|
else:
|
||||||
|
log.info("Impression : %s" % self._fichier)
|
||||||
# Envoi du fichier a CUPS
|
# Envoi du fichier a CUPS
|
||||||
options =''
|
options =''
|
||||||
# Creation de la liste d'options
|
# Creation de la liste d'options
|
||||||
|
@ -441,8 +448,8 @@ class impression:
|
||||||
#(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, self.nom_fichier_pdf))
|
#(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, self.nom_fichier_pdf))
|
||||||
(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, liste_nom_fichier_pdf))
|
(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, liste_nom_fichier_pdf))
|
||||||
if status != 0:
|
if status != 0:
|
||||||
|
log.error("erreur impression")
|
||||||
|
log.error("lpr status:%d | rep: %s" % (status, rep))
|
||||||
raise PrintError, "lpr %s %s \n status:%d rep: %s" % (options, liste_nom_fichier_pdf, status, rep)
|
raise PrintError, "lpr %s %s \n status:%d rep: %s" % (options, liste_nom_fichier_pdf, status, rep)
|
||||||
syslog.openlog("impression")
|
|
||||||
syslog.syslog("lpr status:%d | rep: %s" % (status, rep))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue