Show
Ignore:
Timestamp:
04/08/03 22:38:08 (21 years ago)
Author:
jalet
Message:

The last job Id is saved now for each printer, this will probably
allow other accounting methods in the future.

Files:
1 modified

Legend:

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

    r873 r887  
    2121# 
    2222# $Log$ 
     23# Revision 1.21  2003/04/08 20:38:08  jalet 
     24# The last job Id is saved now for each printer, this will probably 
     25# allow other accounting methods in the future. 
     26# 
    2327# Revision 1.20  2003/03/29 13:45:27  jalet 
    2428# GPL paragraphs were incorrectly (from memory) copied into the sources. 
     
    148152    def getPrinterPageCounter(self, printername) : 
    149153        """Returns the last page counter value for a printer given its name.""" 
    150         result = self.doQuery("SELECT pagecounter, lastusername FROM printers WHERE printername=%s;" % self.doQuote(printername)) 
     154        result = self.doQuery("SELECT pagecounter, lastjobid, lastusername FROM printers WHERE printername=%s;" % self.doQuote(printername)) 
    151155        try : 
    152156            return self.doParseResult(result)[0] 
     
    154158            return 
    155159         
    156     def updatePrinterPageCounter(self, printername, username, pagecount) : 
    157         """Updates the last page counter information for a printer given its name, last username and pagecount.""" 
    158         return self.doQuery("UPDATE printers SET pagecounter=%s, lastusername=%s WHERE printername=%s;" % (self.doQuote(pagecount), self.doQuote(username), self.doQuote(printername))) 
     160    def updatePrinterPageCounter(self, printername, username, pagecount, jobid) : 
     161        """Updates the last page counter information for a printer given its name, last username, pagecount and jobid.""" 
     162        return self.doQuery("UPDATE printers SET pagecounter=%s, lastusername=%s, lastjobid=%s WHERE printername=%s;" % (self.doQuote(pagecount), self.doQuote(username), self.doQuote(jobid), self.doQuote(printername))) 
    159163         
    160164    def addUserPQuota(self, username, printername) :