[impression/,intranet/] on debugge l'AJAX
darcs-hash:20090914113809-bd074-ea3ddaaa14f90fba6bf49cc860b4aaadcc776806.gz
This commit is contained in:
parent
59eb9f55cb
commit
90149fd583
5 changed files with 33 additions and 24 deletions
|
@ -176,7 +176,10 @@ class impression:
|
|||
raise FichierInvalide, ("Le fichier ne semble pas etre un PDF", path_to_pdf)
|
||||
|
||||
# on compte les pages
|
||||
try:
|
||||
self._pages = int(os.popen("pdfinfo %s | grep Pages " % (self._fichier)).readline().split()[1])
|
||||
except Exception, e:
|
||||
raise FichierInvalide, u"pdfinfo n'arrive à lire le fichier (fichier protégé par mot de passe?)"
|
||||
|
||||
# calcule le prix de l'encre tout de suite
|
||||
self._calcule_prix()
|
||||
|
|
|
@ -33,6 +33,7 @@ from re import compile
|
|||
sys.path.append('/usr/scripts/impression')
|
||||
import digicode, etat_imprimante
|
||||
from impression_canon import FichierInvalide,SoldeInsuffisant,impression
|
||||
from traceback import format_exception
|
||||
|
||||
BOOK_REGEXP = compile('book.pdf')
|
||||
FILE_UPLOAD_BASE_FOLDER = cherrypy.config.get('fileUpload.folder', "/var/impression/fichiers/")
|
||||
|
@ -41,6 +42,8 @@ class FileError(Exception):
|
|||
pass
|
||||
from ClassesIntranet.ModuleBase import ModuleBase
|
||||
|
||||
def fmt_exc(e):
|
||||
return '<br/>'.join(format_exception(e))
|
||||
|
||||
# #############################################################
|
||||
# Classe d'impression en multithread
|
||||
|
@ -225,7 +228,7 @@ class main(ModuleBase):
|
|||
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
|
||||
return {"solde" : adh.solde() }
|
||||
except Exception, e:
|
||||
return {"erreure" : str(e)}
|
||||
return {"erreur" : str(e)}
|
||||
AJAXGetSolde.exposed = True
|
||||
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ Impression.settings.images = [
|
|||
"portrait_transparent_couleurs.png",
|
||||
"portrait_transparent_nb.png",
|
||||
];
|
||||
|
||||
/*
|
||||
Impression.settings.preloadImage = function(imageName) {
|
||||
var image = new Image();
|
||||
image.src = "./static/"+imageName;
|
||||
|
@ -42,7 +42,7 @@ Impression.settings.preloadAllImages = function() {
|
|||
log("Preloading images...");
|
||||
map(this.preloadImage,this.images);
|
||||
}
|
||||
|
||||
*/
|
||||
//
|
||||
//// init : parse every field and display preview
|
||||
//
|
||||
|
|
|
@ -151,7 +151,7 @@ nounous</span> </p>
|
|||
Impression.settings.init();
|
||||
//Impression..AJAX.updateSolde();
|
||||
Impression.AJAX.usefile('$fileName');
|
||||
Impression.settings.preloadAllImages();
|
||||
/* Impression.settings.preloadAllImages();*/
|
||||
//-->
|
||||
</script>
|
||||
#else
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* à la place de celle de MockieKit
|
||||
*/
|
||||
try {
|
||||
if (console.firebug) {
|
||||
/* if (console.firebug) {
|
||||
log("Using Firebug console");
|
||||
log = function(m) {console.log(m)};
|
||||
logWarning = function(m){console.warn(m)};
|
||||
|
@ -13,7 +13,10 @@ try {
|
|||
logDebug = function(m){console.debug(m)};
|
||||
logError = function(m){console.error(m)};
|
||||
logFatal = function(m){console.error(m)};
|
||||
} }
|
||||
}
|
||||
*/
|
||||
MochiKit.Logging.logger.useNativeConsole = true
|
||||
}
|
||||
catch (Exception) {}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue