Changeset 2057

Show
Ignore:
Timestamp:
02/13/05 23:48:38 (18 years ago)
Author:
jalet
Message:

Added the md5sum to the history

Location:
pykota/trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r2054 r2057  
    2424# 
    2525# $Log$ 
     26# Revision 1.86  2005/02/13 22:48:37  jalet 
     27# Added the md5sum to the history 
     28# 
    2629# Revision 1.85  2005/02/13 22:02:28  jalet 
    2730# Big database structure changes. Upgrade script is now included as well as 
     
    588591             
    589592            # adds the current job to history     
    590             printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), action, jobsize, jobprice, self.preserveinputfile, self.title, self.copies, self.options, clienthost, self.jobSizeBytes) 
     593            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), \ 
     594                                    action, jobsize, jobprice, self.preserveinputfile, \ 
     595                                    self.title, self.copies, self.options, clienthost, \ 
     596                                    self.jobSizeBytes, self.checksum) 
    591597            self.printMoreInfo(user, printer, _("Job added to history.")) 
    592598             
  • pykota/trunk/bin/lprngpykota

    r2028 r2057  
    2424# 
    2525# $Log$ 
     26# Revision 1.14  2005/02/13 22:48:37  jalet 
     27# Added the md5sum to the history 
     28# 
    2629# Revision 1.13  2005/01/17 08:44:23  jalet 
    2730# Modified copyright years 
     
    177180            jobprice = userpquota.increasePagesUsage(jobsize) 
    178181             
    179             printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), action, jobsize, jobprice, self.preserveinputfile, self.title, self.copies, self.options, clienthost, self.jobSizeBytes) 
     182            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), \ 
     183                                    action, jobsize, jobprice, self.preserveinputfile, \ 
     184                                    self.title, self.copies, self.options, clienthost, \ 
     185                                    self.jobSizeBytes, self.checksum) 
    180186            self.printMoreInfo(user, printer, _("Job added to history.")) 
    181187             
     
    193199            # here accounting was completed, either software, or hardware but over quota 
    194200        else : 
    195             printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), action, filename=self.preserveinputfile, title=self.title, copies=self.copies, options=self.options, clienthost=clienthost, jobsizebytes=self.jobSizeBytes) 
     201            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), \ 
     202                                    action, filename=self.preserveinputfile, title=self.title, \ 
     203                                    copies=self.copies, options=self.options, clienthost=clienthost, \ 
     204                                    jobsizebytes=self.jobSizeBytes, self.checksum) 
    196205            self.logdebug("Job added to history during first pass : Job's size and price are still unknown.") 
    197206             
  • pykota/trunk/pykota/storage.py

    r2054 r2057  
    2222# 
    2323# $Log$ 
     24# Revision 1.69  2005/02/13 22:48:37  jalet 
     25# Added the md5sum to the history 
     26# 
    2427# Revision 1.68  2005/02/13 22:02:29  jalet 
    2528# Big database structure changes. Upgrade script is now included as well as 
     
    380383            raise AttributeError, name 
    381384             
    382     def addJobToHistory(self, jobid, user, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None) : 
     385    def addJobToHistory(self, jobid, user, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None, jobmd5sum=None) : 
    383386        """Adds a job to the printer's history.""" 
    384         self.parent.writeJobNew(self, user, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options, clienthost, jobsizebytes) 
     387        self.parent.writeJobNew(self, user, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options, clienthost, jobsizebytes, jobmd5sum) 
    385388        # TODO : update LastJob object ? Probably not needed. 
    386389         
  • pykota/trunk/pykota/storages/ldapstorage.py

    r2054 r2057  
    2222# 
    2323# $Log$ 
     24# Revision 1.101  2005/02/13 22:48:37  jalet 
     25# Added the md5sum to the history 
     26# 
    2427# Revision 1.100  2005/02/13 22:02:29  jalet 
    2528# Big database structure changes. Upgrade script is now included as well as 
     
    12341237        self.doModify(lastjob.ident, fields)          
    12351238         
    1236     def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None) : 
     1239    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None, jobmd5sum=None) : 
    12371240        """Adds a job in a printer's history.""" 
    12381241        if (not self.disablehistory) or (not printer.LastJob.Exists) : 
     
    12591262                   "pykotaHostName" : str(clienthost),  
    12601263                   "pykotaJobSizeBytes" : str(jobsizebytes), 
    1261                    # TODO : add the 3 missing fields 
     1264                   "pykotaMD5Sum" : str(jobmd5sum), 
    12621265                 } 
    12631266        if (not self.disablehistory) or (not printer.LastJob.Exists) : 
  • pykota/trunk/pykota/storages/sql.py

    r2054 r2057  
    2222# 
    2323# $Log$ 
     24# Revision 1.66  2005/02/13 22:48:38  jalet 
     25# Added the md5sum to the history 
     26# 
    2427# Revision 1.65  2005/02/13 22:02:29  jalet 
    2528# Big database structure changes. Upgrade script is now included as well as 
     
    565568        self.doModify("UPDATE jobhistory SET jobsize=%s, jobprice=%s WHERE id=%s" % (self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(lastjob.ident))) 
    566569         
    567     def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None) : 
     570    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None, jobmd5sum=None) : 
    568571        """Adds a job in a printer's history.""" 
    569572        if self.privacy :     
     
    575578        if (not self.disablehistory) or (not printer.LastJob.Exists) : 
    576579            if jobsize is not None : 
    577                 self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options, hostname, jobsizebytes) VALUES (%s, %s, %s, %s, %s, %s, %s, %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), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes))) 
     580                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options, hostname, jobsizebytes, md5sum) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %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), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes), self.doQuote(jobmd5sum))) 
    578581            else :     
    579                 self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, filename, title, copies, options, hostname, jobsizebytes) VALUES (%s, %s, %s, %s, %s, %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(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes))) 
     582                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, filename, title, copies, options, hostname, jobsizebytes, md5sum) VALUES (%s, %s, %s, %s, %s, %s, %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(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes), self.doQuote(jobmd5sum))) 
    580583        else :         
    581584            # here we explicitly want to reset jobsize to NULL if needed 
    582             self.doModify("UPDATE jobhistory SET userid=%s, jobid=%s, pagecounter=%s, action=%s, jobsize=%s, jobprice=%s, filename=%s, title=%s, copies=%s, options=%s, hostname=%s, jobsizebytes=%s, jobdate=now() WHERE id=%s" % (self.doQuote(user.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes), self.doQuote(printer.LastJob.ident))) 
     585            self.doModify("UPDATE jobhistory SET userid=%s, jobid=%s, pagecounter=%s, action=%s, jobsize=%s, jobprice=%s, filename=%s, title=%s, copies=%s, options=%s, hostname=%s, jobsizebytes=%s, md5sum=%s, jobdate=now() WHERE id=%s" % (self.doQuote(user.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes), self.doQuote(jobmd5sum), self.doQuote(printer.LastJob.ident))) 
    583586             
    584587    def writeUserPQuotaLimits(self, userpquota, softlimit, hardlimit) :