[impression_canon] ne débite qu'en cas de succès
This commit is contained in:
parent
e52290712c
commit
3cb9891731
1 changed files with 3 additions and 4 deletions
|
@ -202,7 +202,7 @@ class impression:
|
||||||
# on compte les pages et on regarde le format
|
# on compte les pages et on regarde le format
|
||||||
pdfinfo = Popen(["pdfinfo",self._fichier],stdout=PIPE,stderr=PIPE).communicate()
|
pdfinfo = Popen(["pdfinfo",self._fichier],stdout=PIPE,stderr=PIPE).communicate()
|
||||||
if pdfinfo[1] <> '':
|
if pdfinfo[1] <> '':
|
||||||
raise FichierInvalide(u"pdfinfo n'arrive pas a lire le fichier (il est peut-etre corrompu ou protege par un mot de passe)",path_to_pdf)
|
raise FichierInvalide(u"pdfinfo n'arrive pas a lire le fichier (il est peut-etre corrompu ou protege par un mot de passe), https://wiki.crans.org/VieCrans/ImpressionReseau#Format_des_fichiers",path_to_pdf)
|
||||||
self._pages = -1
|
self._pages = -1
|
||||||
for line in pdfinfo[0].split('\n'):
|
for line in pdfinfo[0].split('\n'):
|
||||||
if line.startswith('Pages'):
|
if line.startswith('Pages'):
|
||||||
|
@ -378,6 +378,8 @@ class impression:
|
||||||
"""
|
"""
|
||||||
self._jid = _uniq_jid()
|
self._jid = _uniq_jid()
|
||||||
|
|
||||||
|
# imprime le document
|
||||||
|
self._exec_imprime()
|
||||||
# debite l'adhérent si adherent il y a
|
# debite l'adhérent si adherent il y a
|
||||||
if (self._adh != None):
|
if (self._adh != None):
|
||||||
adh = self._adh.split('@')
|
adh = self._adh.split('@')
|
||||||
|
@ -389,9 +391,6 @@ class impression:
|
||||||
adh.solde(-self._prix, "impression(%d): %s par %s" % (self._jid,self._fichier,self._adh))
|
adh.solde(-self._prix, "impression(%d): %s par %s" % (self._jid,self._fichier,self._adh))
|
||||||
adh.save()
|
adh.save()
|
||||||
del adh
|
del adh
|
||||||
# imprime le document
|
|
||||||
self._exec_imprime()
|
|
||||||
|
|
||||||
|
|
||||||
def _calcule_prix(self):
|
def _calcule_prix(self):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue