Show
Ignore:
Timestamp:
10/08/03 09:01:20 (21 years ago)
Author:
jalet
Message:

Job history can be disabled.
Some typos in README.
More messages in setup script.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r1147 r1149  
    2222# 
    2323# $Log$ 
     24# Revision 1.33  2003/10/08 07:01:20  jalet 
     25# Job history can be disabled. 
     26# Some typos in README. 
     27# More messages in setup script. 
     28# 
    2429# Revision 1.32  2003/10/07 14:23:25  jalet 
    2530# More work on cache 
     
    664669    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None) :     
    665670        """Adds a job in a printer's history.""" 
    666         uuid = self.genUUID() 
     671        if (not self.disablehistory) or (not printer.LastJob.Exists) : 
     672            uuid = self.genUUID() 
     673            dn = "cn=%s,%s" % (uuid, self.info["jobbase"]) 
     674        else :     
     675            uuid = printer.LastJob.ident[3:].split(",")[0] 
     676            dn = printer.LastJob.ident 
    667677        fields = { 
    668678                   "objectClass" : ["pykotaObject", "pykotaJob"], 
     
    674684                   "pykotaAction" : action, 
    675685                 } 
    676         if jobsize is not None :          
     686        if (not self.disablehistory) or (not printer.LastJob.Exists) : 
     687            if jobsize is not None :          
     688                fields.update({ "pykotaJobSize" : str(jobsize) }) 
     689            self.doAdd(dn, fields) 
     690        else :     
     691            # here we explicitly want to reset jobsize to 'None' if needed 
    677692            fields.update({ "pykotaJobSize" : str(jobsize) }) 
    678         dn = "cn=%s,%s" % (uuid, self.info["jobbase"]) 
    679         self.doAdd(dn, fields) 
     693            self.doModify(dn, fields) 
     694             
    680695        if printer.LastJob.Exists : 
    681696            fields = {