Changeset 722
- Timestamp:
- 02/06/03 16:03:11 (22 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/sql.py
r721 r722 15 15 # 16 16 # $Log$ 17 # Revision 1.10 2003/02/06 15:03:11 jalet 18 # added a method to set the limit date 19 # 17 20 # Revision 1.9 2003/02/06 14:52:35 jalet 18 21 # Forgotten import … … 123 126 self.doQuery("UPDATE userpquota SET softlimit=%s, hardlimit=%s, datelimit=NULL WHERE userid=%s AND printerid=%s;" % (self.doQuote(softlimit), self.doQuote(hardlimit), self.doQuote(userid), self.doQuote(printerid))) 124 127 128 def setDateLimit(username, printername, datelimit) : 129 """Sets the limit date for a soft limit to become an hard one given (username, printername).""" 130 (userid, printerid) = self.getUPIds(username, printername) 131 if (userid is not None) and (printerid is not None) : 132 self.doQuery("UPDATE userpquota SET datelimit=%s::DATETIME WHERE userid=%s AND printerid=%s;" % (self.doQuote("%04i-%02i-%02i %02i:%02i:%02i" % (datelimit.year, datelimit.month, datelimit.day, datelimit.hour, datelimit.minute, datelimit.second)), self.doQuote(userid), self.doQuote(printerid))) 133 125 134 def updateUserPQuota(self, username, printername, pagecount) : 126 135 """Updates the used user Quota information given (username, printername) and a job size in pages.""" -
pykota/trunk/pykota/tool.py
r715 r722 15 15 # 16 16 # $Log$ 17 # Revision 1.10 2003/02/06 15:03:11 jalet 18 # added a method to set the limit date 19 # 17 20 # Revision 1.9 2003/02/06 10:39:23 jalet 18 21 # Preliminary edpykota work. … … 193 196 if datelimit is None : 194 197 datelimit = now + gracedelay 195 self.storage. doQuery("UPDATE userpquota SET datelimit=%s::DATETIME WHERE userid=%s AND printerid=%s;" % (self.doQuote("%04i-%02i-%02i %02i:%02i:%02i" % (datelimit.year, datelimit.month, datelimit.day, datelimit.hour, datelimit.minute, datelimit.second)), self.doQuote(self.getUserId(username)), self.doQuote(self.getPrinterId(printername))))198 self.storage.setDateLimit(username, printername, datelimit) 196 199 if (now + gracedelay) < datelimit : 197 200 action = "WARN"