[impression_canon] fix + proprete
darcs-hash:20091102143816-bd074-e37ecdb9ef922b7adefa034db3ab1e9c356f45cb.gz
This commit is contained in:
parent
d1c0935c1b
commit
b639d90a11
1 changed files with 13 additions and 9 deletions
|
@ -28,13 +28,12 @@
|
|||
Classe pour gérer l'envoie de pdf à l'imprimante.
|
||||
Calcule le coût des options d'impression.
|
||||
"""
|
||||
__version__ = '1'
|
||||
__version__ = '9.11'
|
||||
|
||||
import sys, syslog, os.path, time
|
||||
import sys, os.path
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
from config import impression as config_impression
|
||||
from commands import getstatusoutput
|
||||
from crans.utils import QuoteForPOSIX as escapeForShell
|
||||
import crans.utils.logs
|
||||
|
||||
# ######################################################## #
|
||||
|
@ -375,7 +374,6 @@ class impression:
|
|||
|
||||
def _get_adh(self, adh):
|
||||
if type(adh) == str:
|
||||
import sys
|
||||
sys.path.append("/usr/scripts/gestion/")
|
||||
#from ldap_crans_test import crans_ldap
|
||||
from ldap_crans import CransLdap
|
||||
|
@ -457,15 +455,21 @@ class impression:
|
|||
if not self._settings['livret'] and self._settings['agrafage'] in ['None', None]:
|
||||
left = self._settings['copies']
|
||||
while left >= 100:
|
||||
"lpr %s -# %d %s" % (options, 99, self._fichier)
|
||||
cmd = "lpr %s -# %d %s" % (options, 99, self._fichier)
|
||||
left -= 99
|
||||
(status, rep) = getstatusoutput(cmd)
|
||||
self.log.info("printing: %s" % cmd)
|
||||
if status != 0:
|
||||
self.log.error("erreur impression")
|
||||
self.log.error("lpr status:%d | rep: %s" % (status, rep))
|
||||
raise PrintError, "%s \n status:%d rep: %s" % (cmd, status, rep)
|
||||
cmd = "lpr %s -# %d %s" % (options, left, self._fichier)
|
||||
(status, rep) = getstatusoutput(cmd)
|
||||
self.log.info("printing: %s" % cmd)
|
||||
if status != 0:
|
||||
self.log.error("erreur impression")
|
||||
self.log.error("lpr status:%d | rep: %s" % (status, rep))
|
||||
raise PrintError, "%s \n status:%d rep: %s" % (cmp, status, rep)
|
||||
raise PrintError, "%s \n status:%d rep: %s" % (cmd, status, rep)
|
||||
|
||||
else:
|
||||
cmd = "lpr %s %s" % (options, self._fichier)
|
||||
|
@ -475,4 +479,4 @@ class impression:
|
|||
if status != 0:
|
||||
self.log.error("erreur impression")
|
||||
self.log.error("lpr status:%d | rep: %s" % (status, rep))
|
||||
raise PrintError, "%s \n status:%d rep: %s" % (cmp, status, rep)
|
||||
raise PrintError, "%s \n status:%d rep: %s" % (cmd, status, rep)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue