passage des argument sans failles (enfin, j'espre)

darcs-hash:20061025190929-f46e9-c9d8289b67df3b52258dcbef70d8f1d70d9a2fa7.gz
This commit is contained in:
gdetrez 2006-10-25 21:09:29 +02:00
parent 84c2f0eff1
commit 4a2a8ce3bf

View file

@ -30,6 +30,8 @@ import sys, syslog, os.path
sys.path.append('/usr/scripts/gestion')
import config
import cout
from crans.utils import QuoteForPOSIX as escapeForShell
# ######################################################## #
# CONSTANTES #
# ######################################################## #
@ -158,7 +160,7 @@ class impression:
self._fichier = path_to_pdf
if not os.path.isfile(path_to_pdf):
raise FichierInvalide, "Nom de fichier invalide"
os.system("/usr/scripts/impression/compatibilise \"%s\"" % path_to_pdf)
os.system("/usr/scripts/impression/compatibilise %s" % escapeForShell( path_to_pdf ) )
self._adh = adh
@ -357,7 +359,7 @@ class impression:
options += LPR_OPTIONS[self._settings['couleurs']]
liste_nom_fichier_pdf=(' "'+self._fichier + "\"")*self._settings['copies']
liste_nom_fichier_pdf=(' '+escapeForShell( self._fichier ) )*self._settings['copies']
import commands
#(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, self.nom_fichier_pdf))
(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, liste_nom_fichier_pdf))