liste uniquement les fichiers pdf dans la fenetre de selection.
darcs-hash:20070916011140-7b604-29caede0f1335490c7930de5960c5bb278f28f42.gz
This commit is contained in:
parent
97779609f1
commit
2bf253110c
1 changed files with 10 additions and 4 deletions
|
@ -24,7 +24,7 @@
|
|||
# Copyright (c) 2006 by www.crans.org
|
||||
# #############################################################
|
||||
|
||||
import cherrypy, tempfile, shutil, os
|
||||
import cherrypy, tempfile, shutil, os, commands
|
||||
import crans.impression
|
||||
import crans.impression.digicode
|
||||
import crans.impression.etat_imprimante
|
||||
|
@ -191,7 +191,7 @@ class main(ModuleBase):
|
|||
#
|
||||
def etatImprimante(self):
|
||||
if not cherrypy.config.get('crans.activate', True):
|
||||
return {"printer_state" : u"SystÃÂÃ
¡me down"}
|
||||
return {"printer_state" : u"Système down"}
|
||||
try:
|
||||
return {"printer_state" : u"\\n".join(crans.impression.etat_imprimante.etat())}
|
||||
except Exception, e:
|
||||
|
@ -216,13 +216,19 @@ class main(ModuleBase):
|
|||
# privees
|
||||
##########################
|
||||
#
|
||||
# methode pour obtenir la liste des fichiers uploadÃÂÃÂÃÂés
|
||||
# methode pour obtenir la liste des fichiers uploadés
|
||||
#
|
||||
def getUploadedFileListFor(self, adh):
|
||||
file_folder = os.path.join(FILE_UPLOAD_BASE_FOLDER, cherrypy.session['uid']+"/")
|
||||
if not os.path.isdir(file_folder):
|
||||
return []
|
||||
return os.listdir(file_folder)
|
||||
list = os.listdir(file_folder)
|
||||
list_pdf = []
|
||||
# exclusion des fichiers qui ne sont pas des PDF
|
||||
for f in list:
|
||||
if commands.getoutput('file -ib %s' % commands.mk2arg(file_folder, f)) == "application/pdf":
|
||||
list_pdf.append(f)
|
||||
return list_pdf
|
||||
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue