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/pgstorage.py

    r1144 r1149  
    2222# 
    2323# $Log$ 
     24# Revision 1.19  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.18  2003/10/07 09:07:30  jalet 
    2530# Character encoding added to please latest version of Python 
     
    420425    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None) :     
    421426        """Adds a job in a printer's history.""" 
    422         if jobsize is not None : 
    423             self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, jobsize) VALUES (%s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize))) 
    424         else :     
    425             self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action) VALUES (%s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action))) 
     427        if (not self.disablehistory) or (not printer.LastJob.Exists) : 
     428            if jobsize is not None : 
     429                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, jobsize) VALUES (%s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize))) 
     430            else :     
     431                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action) VALUES (%s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action))) 
     432        else :         
     433            # here we explicitly want to reset jobsize to NULL if needed 
     434            self.doModify("UPDATE jobhistory SET userid=%s, jobid=%s, pagecounter=%s, action=%s, jobsize=%s, jobdate=now() WHERE id=%s;" % (self.doQuote(user.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(printer.LastJob.ident))) 
    426435             
    427436    def writeUserPQuotaLimits(self, userpquota, softlimit, hardlimit) :