bugfix : on traite le cas ou le .ps n'as jamais t cre

darcs-hash:20070916081738-f6463-826b08d06b8bdcd6516c92a9f21394e74f879c3d.gz
This commit is contained in:
cohen 2007-09-16 10:17:38 +02:00
parent 2bf253110c
commit 69d16b0458

View file

@ -87,7 +87,7 @@ def base_prix(path_pdf_file, color=False):
nom_rep = tempfile.mkdtemp(prefix='tmpimpr')
nom_png = "%s/convert.png" % nom_rep # Nom prefixe et chemin des png créé par convert
escaped_path_pdf_file = escapeForShell(path_pdf_file)
escaped_path_ps_file = path_pdf_file + ".ps"
escaped_path_ps_file = escapeForShell(path_pdf_file + ".ps")
error_msg = "ERREUR %%d : Fichier invalide. Aucun %s cree."
if color:
error_msg += " (couleurs)"
@ -99,7 +99,8 @@ def base_prix(path_pdf_file, color=False):
nb_composante = 1 # Noir
percent_program = "percentblack"
if os.stat(path_pdf_file)[stat.ST_MTIME] > os.stat(path_pdf_file + ".ps")[stat.ST_MTIME]:
if not os.access(path_pdf_file + ".ps",os.F_OK) or \
os.stat(path_pdf_file)[stat.ST_MTIME] > os.stat(path_pdf_file + ".ps")[stat.ST_MTIME]:
# Convertit les pdf en ps
try_command("nice -n 5 pdftops %s %s" % (escaped_path_pdf_file,
escaped_path_ps_file),