Changeset 2057 for pykota/trunk/pykota

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

Added the md5sum to the history

Location:
pykota/trunk/pykota
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • 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) :