Simplification des messages d'erreur pour les adhrents et ajout d'un test pour voir si le fichier est bien pdf
darcs-hash:20061116222504-f46e9-1a7343559bbf6b98e2d1a22ced1162413720f418.gz
This commit is contained in:
parent
dce073de67
commit
cb801d4734
2 changed files with 25 additions and 6 deletions
|
@ -50,7 +50,13 @@ COUT_PASSAGE_TAMBOUR_COULEUR = config.impression.c_tambour_coul
|
|||
#
|
||||
#
|
||||
class FichierInvalide(Exception):
|
||||
pass
|
||||
def __str__(self):
|
||||
return self.args[0]
|
||||
def file(self):
|
||||
try:
|
||||
return self.args[1]
|
||||
except:
|
||||
return "n/a"
|
||||
# ########################################################### #
|
||||
# PRIX COULEURS #
|
||||
# ########################################################### #
|
||||
|
@ -67,7 +73,7 @@ def base_prix_couleurs(path_fichier_pdf):
|
|||
# Convertit les pdf en png couleur
|
||||
(status, rep) = commands.getstatusoutput("nice -n 5 gs -sDEVICE=png16m -r30 -dBATCH -dNOPAUSE -dSAFER -dPARANOIDSAFER -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dMaxBitmap=50000000 -sOutputFile=%s%%d -q %s" % (nom_png, escapeForShell(path_fichier_pdf)))
|
||||
if status:
|
||||
raise FichierInvalide("ERREUR %s : Fichier invalide. Aucun png cree. (couleurs)" % status)
|
||||
raise FichierInvalide, "ERREUR %s : Fichier invalide. Aucun png cree. (couleurs)" % status
|
||||
|
||||
# Récupère la liste des fichiers
|
||||
list_filepng=os.listdir(nom_rep)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue