Typographie.
darcs-hash:20060219000118-68412-2a40af702ab413bdba443be66a148ae23afb8aae.gz
This commit is contained in:
parent
fe603296b4
commit
b52b0eb7a0
1 changed files with 64 additions and 63 deletions
|
@ -8,11 +8,12 @@ Inspir
|
|||
Licence : GNU General Public Licence, version 2
|
||||
"""
|
||||
|
||||
import sys, time, tempfile, os, commands, string, random, syslog
|
||||
import sys, time, tempfile, os, commands, string, random
|
||||
sys.path.append('/usr/scripts/impression')
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
from config import impression
|
||||
from ldap_crans import crans_ldap
|
||||
from syslog import openlog, syslog, LOG_DEBUG
|
||||
|
||||
duree_vie_pdf=3600
|
||||
|
||||
|
@ -83,15 +84,15 @@ class fichier_impression :
|
|||
self.erreur_critique = True
|
||||
self.list_messages_importants.append('erreur_critique')
|
||||
self.list_messages_admin.append('erreur_cout')
|
||||
syslog.openlog("impression")
|
||||
syslog.syslog(retour)
|
||||
openlog("impression")
|
||||
syslog(retour)
|
||||
|
||||
# Repond vrai si le solde est assez élevé.
|
||||
def test_cout(self):
|
||||
if self.user_ldap == None:
|
||||
self.user_ldap = utilisateur(self.user, False)
|
||||
return not (self.cout > (self.user_ldap.solde() -
|
||||
impression.decouvert)) # /!\ decouvert est négatif.
|
||||
# /!\ decouvert est négatif.
|
||||
return not (self.cout > (self.user_ldap.solde() - impression.decouvert))
|
||||
|
||||
def fait_payer(self):
|
||||
self.user_ldap = utilisateur(self.user, True)
|
||||
|
@ -180,8 +181,8 @@ class fichier_impression :
|
|||
(status,rep) = commands.getstatusoutput("lpr %s %s" % (options, self.nom_fichier_pdf))
|
||||
if status != 0:
|
||||
print "<p>status:%d rep: %s</p>" % (status, rep)
|
||||
syslog.openlog("impression")
|
||||
syslog.syslog("lpr status:%d | rep: %s" % (status, rep))
|
||||
openlog("impression")
|
||||
syslog("lpr status:%d | rep: %s" % (status, rep))
|
||||
|
||||
def corrige(self):
|
||||
# Trouve le nombre de pages
|
||||
|
@ -222,7 +223,7 @@ class fichier_impression :
|
|||
return "<p>%s</p>" % body
|
||||
|
||||
def enregistre_pdf(self, f_value, f_nom, dossier):
|
||||
syslog.openlog("impression")
|
||||
openlog("impression")
|
||||
try:
|
||||
(fd_fichier_desc, self.nom_fichier_desc) = tempfile.mkstemp(suffix='.desc', prefix='job', dir=dossier)
|
||||
os.close(fd_fichier_desc)
|
||||
|
@ -290,8 +291,8 @@ class fichier_impression :
|
|||
if not os.path.exists(self.nom_fichier_pdf):
|
||||
if self.imprime != -3:
|
||||
self.imprime = -4
|
||||
syslog.openlog("impression")
|
||||
syslog.syslog("class : %s a disparu" % self.nom_fichier_pdf)
|
||||
openlog("impression")
|
||||
syslog("class : %s a disparu" % self.nom_fichier_pdf)
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -359,8 +360,8 @@ def utilisateur(user, rw):
|
|||
if len(res) != 1 :
|
||||
raise ErreurImpression("class : adherent %s introuvable\n" % user)
|
||||
adherent = res[0]
|
||||
syslog.openlog("impression")
|
||||
syslog.syslog(syslog.LOG_DEBUG,"class : Adherent %s (aid=%s) recupere.\n" % (user, adherent.id()))
|
||||
openlog("impression")
|
||||
syslog(LOG_DEBUG,"class : Adherent %s (aid=%s) recupere.\n" % (user, adherent.id()))
|
||||
return adherent
|
||||
|
||||
################################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue