Changeset 2057 for pykota/trunk
- Timestamp:
- 02/13/05 23:48:38 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r2054 r2057 24 24 # 25 25 # $Log$ 26 # Revision 1.86 2005/02/13 22:48:37 jalet 27 # Added the md5sum to the history 28 # 26 29 # Revision 1.85 2005/02/13 22:02:28 jalet 27 30 # Big database structure changes. Upgrade script is now included as well as … … 588 591 589 592 # 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) 591 597 self.printMoreInfo(user, printer, _("Job added to history.")) 592 598 -
pykota/trunk/bin/lprngpykota
r2028 r2057 24 24 # 25 25 # $Log$ 26 # Revision 1.14 2005/02/13 22:48:37 jalet 27 # Added the md5sum to the history 28 # 26 29 # Revision 1.13 2005/01/17 08:44:23 jalet 27 30 # Modified copyright years … … 177 180 jobprice = userpquota.increasePagesUsage(jobsize) 178 181 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) 180 186 self.printMoreInfo(user, printer, _("Job added to history.")) 181 187 … … 193 199 # here accounting was completed, either software, or hardware but over quota 194 200 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) 196 205 self.logdebug("Job added to history during first pass : Job's size and price are still unknown.") 197 206 -
pykota/trunk/pykota/storage.py
r2054 r2057 22 22 # 23 23 # $Log$ 24 # Revision 1.69 2005/02/13 22:48:37 jalet 25 # Added the md5sum to the history 26 # 24 27 # Revision 1.68 2005/02/13 22:02:29 jalet 25 28 # Big database structure changes. Upgrade script is now included as well as … … 380 383 raise AttributeError, name 381 384 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) : 383 386 """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) 385 388 # TODO : update LastJob object ? Probably not needed. 386 389 -
pykota/trunk/pykota/storages/ldapstorage.py
r2054 r2057 22 22 # 23 23 # $Log$ 24 # Revision 1.101 2005/02/13 22:48:37 jalet 25 # Added the md5sum to the history 26 # 24 27 # Revision 1.100 2005/02/13 22:02:29 jalet 25 28 # Big database structure changes. Upgrade script is now included as well as … … 1234 1237 self.doModify(lastjob.ident, fields) 1235 1238 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) : 1237 1240 """Adds a job in a printer's history.""" 1238 1241 if (not self.disablehistory) or (not printer.LastJob.Exists) : … … 1259 1262 "pykotaHostName" : str(clienthost), 1260 1263 "pykotaJobSizeBytes" : str(jobsizebytes), 1261 # TODO : add the 3 missing fields1264 "pykotaMD5Sum" : str(jobmd5sum), 1262 1265 } 1263 1266 if (not self.disablehistory) or (not printer.LastJob.Exists) : -
pykota/trunk/pykota/storages/sql.py
r2054 r2057 22 22 # 23 23 # $Log$ 24 # Revision 1.66 2005/02/13 22:48:38 jalet 25 # Added the md5sum to the history 26 # 24 27 # Revision 1.65 2005/02/13 22:02:29 jalet 25 28 # Big database structure changes. Upgrade script is now included as well as … … 565 568 self.doModify("UPDATE jobhistory SET jobsize=%s, jobprice=%s WHERE id=%s" % (self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(lastjob.ident))) 566 569 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) : 568 571 """Adds a job in a printer's history.""" 569 572 if self.privacy : … … 575 578 if (not self.disablehistory) or (not printer.LastJob.Exists) : 576 579 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))) 578 581 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))) 580 583 else : 581 584 # 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))) 583 586 584 587 def writeUserPQuotaLimits(self, userpquota, softlimit, hardlimit) :