impression_hp: avoid fichiers commençant par -
This commit is contained in:
parent
187b72cf27
commit
561f4b832c
1 changed files with 9 additions and 9 deletions
|
@ -424,12 +424,6 @@ class impression(object):
|
|||
# Création de la liste d'options pour lp
|
||||
options = list()
|
||||
|
||||
# TODO que se passe-t-il si le fichier commence par -o ou -- ?
|
||||
if self._settings['livret'].value:
|
||||
options.append(self._pdfbook())
|
||||
else:
|
||||
options.append(self._fichier)
|
||||
|
||||
|
||||
# Pour spécifier l'imprimante
|
||||
options += ['-d', 'MFPM880']
|
||||
|
@ -444,7 +438,7 @@ class impression(object):
|
|||
options += ['-o', 'Collate=True']
|
||||
|
||||
# Pour donner le login de l'adherent (TODO: useful ?)
|
||||
options += ['-U', str(self._adh)]
|
||||
#options += ['-U', str(self._adh)]
|
||||
|
||||
if self._settings['papier'].value == 'A4':
|
||||
options += ['-o', 'PageSize=A4']
|
||||
|
@ -496,11 +490,17 @@ class impression(object):
|
|||
v = self._settings['agrafage'].HP_name()
|
||||
options += ['-o', 'HPStaplerOptions=%s' % v]
|
||||
|
||||
# Que se passe-t-il si le nom de fichier commence par - ?
|
||||
# pour éviter cela, on indique la fin des options, avec "--"
|
||||
options.append('--')
|
||||
if self._settings['livret'].value:
|
||||
options.append(self._pdfbook())
|
||||
else:
|
||||
options.append(self._fichier)
|
||||
|
||||
if not DEBUG:
|
||||
logger.info("lp " + " ".join(options))
|
||||
check_output(['lp'] + options)
|
||||
else:
|
||||
logger.info("pretend printing (debug): " + " ".join(options))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue