diff --git a/lib/impression/cout.py b/lib/impression/cout.py index 85176336..a9225c86 100755 --- a/lib/impression/cout.py +++ b/lib/impression/cout.py @@ -28,6 +28,9 @@ Copyright (c) 2006 by www.crans.org """ +# Début : Ajout log pour réestimer les coûts +import time +# Fin import sys, tempfile, os, commands, shutil, syslog, stat sys.path.append('/usr/scripts/gestion') import config @@ -46,6 +49,10 @@ COUT_UNITE_NOIRE = config.impression.c_noir COUT_PASSAGE_TAMBOUR_NOIR = config.impression.c_tambour_noir COUT_PASSAGE_TAMBOUR_COULEUR = config.impression.c_tambour_coul +# Début : Ajout log pour réestimer les coûts +FICHIER_LOG="/var/log/log_couts/estimations" +# Fin + # ########################################################### # # ERREURS # # ########################################################### # @@ -140,6 +147,12 @@ def base_prix(path_pdf_file, color=False): c_total = (COUT_PASSAGE_TAMBOUR_NOIR * faces # passage dans les toners + COUT_UNITE_NOIRE * total_noir) # cout encre noire + # Début : Ajout log pour réestimer les coûts + fichier_log_est=open(FICHIER_LOG,"a") + fichier_log_est.write("%d %d %3d %10.3f %10.3f %s\n" % (time.time(), color, faces, total_noir, total_couleur, path_pdf_file) ) + fichier_log_est.close() + # Fin + return (float(c_total)/100, faces) # ########################################################### #