passage des argument sans failles (enfin, j'espre)
darcs-hash:20061025190929-f46e9-c9d8289b67df3b52258dcbef70d8f1d70d9a2fa7.gz
This commit is contained in:
parent
84c2f0eff1
commit
4a2a8ce3bf
1 changed files with 4 additions and 2 deletions
|
@ -30,6 +30,8 @@ import sys, syslog, os.path
|
||||||
sys.path.append('/usr/scripts/gestion')
|
sys.path.append('/usr/scripts/gestion')
|
||||||
import config
|
import config
|
||||||
import cout
|
import cout
|
||||||
|
from crans.utils import QuoteForPOSIX as escapeForShell
|
||||||
|
|
||||||
# ######################################################## #
|
# ######################################################## #
|
||||||
# CONSTANTES #
|
# CONSTANTES #
|
||||||
# ######################################################## #
|
# ######################################################## #
|
||||||
|
@ -158,7 +160,7 @@ class impression:
|
||||||
self._fichier = path_to_pdf
|
self._fichier = path_to_pdf
|
||||||
if not os.path.isfile(path_to_pdf):
|
if not os.path.isfile(path_to_pdf):
|
||||||
raise FichierInvalide, "Nom de fichier invalide"
|
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
|
self._adh = adh
|
||||||
|
@ -357,7 +359,7 @@ class impression:
|
||||||
options += LPR_OPTIONS[self._settings['couleurs']]
|
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
|
import commands
|
||||||
#(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, self.nom_fichier_pdf))
|
#(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, self.nom_fichier_pdf))
|
||||||
(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, liste_nom_fichier_pdf))
|
(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, liste_nom_fichier_pdf))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue