Log en vue d une estimation des couts
darcs-hash:20080625010105-fbba6-3d808b650f145a007a25124ea788b1124c583d32.gz
This commit is contained in:
parent
d4db42902c
commit
06f4336670
1 changed files with 13 additions and 0 deletions
|
@ -28,6 +28,9 @@
|
||||||
Copyright (c) 2006 by www.crans.org
|
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
|
import sys, tempfile, os, commands, shutil, syslog, stat
|
||||||
sys.path.append('/usr/scripts/gestion')
|
sys.path.append('/usr/scripts/gestion')
|
||||||
import config
|
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_NOIR = config.impression.c_tambour_noir
|
||||||
COUT_PASSAGE_TAMBOUR_COULEUR = config.impression.c_tambour_coul
|
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 #
|
# ERREURS #
|
||||||
# ########################################################### #
|
# ########################################################### #
|
||||||
|
@ -140,6 +147,12 @@ def base_prix(path_pdf_file, color=False):
|
||||||
c_total = (COUT_PASSAGE_TAMBOUR_NOIR * faces # passage dans les toners
|
c_total = (COUT_PASSAGE_TAMBOUR_NOIR * faces # passage dans les toners
|
||||||
+ COUT_UNITE_NOIRE * total_noir) # cout encre noire
|
+ 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)
|
return (float(c_total)/100, faces)
|
||||||
|
|
||||||
# ########################################################### #
|
# ########################################################### #
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue