Changeset 1330 for pykota/trunk/pykota
- Timestamp:
- 02/04/04 12:17:00 (20 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storage.py
r1285 r1330 22 22 # 23 23 # $Log$ 24 # Revision 1.39 2004/02/04 11:16:59 jalet 25 # pkprinters command line tool added. 26 # 24 27 # Revision 1.38 2004/01/12 22:43:40 jalet 25 28 # New formula to compute a job's price … … 272 275 self.PricePerJob = float(priceperjob) 273 276 self.parent.writePrinterPrices(self) 277 278 def delete(self) : 279 """Deletes a printer from the Quota Storage.""" 280 self.parent.beginTransaction() 281 try : 282 self.parent.deletePrinter(self) 283 except PyKotaStorageError, msg : 284 self.parent.rollbackTransaction() 285 raise PyKotaStorageError, msg 286 else : 287 self.parent.commitTransaction() 274 288 275 289 class StorageUserPQuota(StorageObject) : -
pykota/trunk/pykota/storages/ldapstorage.py
r1320 r1330 22 22 # 23 23 # $Log$ 24 # Revision 1.50 2004/02/04 11:17:00 jalet 25 # pkprinters command line tool added. 26 # 24 27 # Revision 1.49 2004/01/29 22:35:45 jalet 25 28 # Small fix from Matt. … … 974 977 else : 975 978 self.doDelete(group.ident) 976 979 980 def deletePrinter(self, printer) : 981 """Completely deletes an user from the Quota Storage.""" 982 result = self.doSearch("(&(objectClass=pykotaLastJob)(pykotaPrinterName=%s))" % printer.Name, base=self.info["lastjobbase"]) 983 for (ident, fields) in result : 984 self.doDelete(ident) 985 result = self.doSearch("(&(objectClass=pykotaJob)(pykotaPrinterName=%s))" % printer.Name, base=self.info["jobbase"]) 986 for (ident, fields) in result : 987 self.doDelete(ident) 988 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaPrinterName=%s))" % printer.Name, base=self.info["groupquotabase"]) 989 for (ident, fields) in result : 990 self.doDelete(ident) 991 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s))" % printer.Name, base=self.info["userquotabase"]) 992 for (ident, fields) in result : 993 self.doDelete(ident) 994 for parent in self.getParentPrinters(printer) : 995 parent.uniqueMember.remove(printer.ident) 996 fields = { 997 "uniqueMember" : parent.uniqueMember, 998 } 999 self.doModify(parent.ident, fields) 1000 self.doDelete(printer.ident) -
pykota/trunk/pykota/storages/sql.py
r1327 r1330 22 22 # 23 23 # $Log$ 24 # Revision 1.35 2004/02/04 11:17:00 jalet 25 # pkprinters command line tool added. 26 # 24 27 # Revision 1.34 2004/02/02 22:44:16 jalet 25 28 # Preliminary work on Relationnal Database Independance via DB-API 2.0 … … 408 411 ] : 409 412 self.doModify(q) 410 413 414 def deletePrinter(self, printer) : 415 """Completely deletes a printer from the Quota Storage.""" 416 for q in [ 417 "DELETE FROM printergroupsmembers WHERE groupid=%s OR printerid=%s" % (self.doQuote(printer.ident), self.doQuote(printer.ident)), 418 "DELETE FROM jobhistory WHERE printerid=%s" % self.doQuote(printer.ident), 419 "DELETE FROM grouppquota WHERE printerid=%s" % self.doQuote(printer.ident), 420 "DELETE FROM userpquota WHERE printerid=%s" % self.doQuote(printer.ident), 421 "DELETE FROM printers WHERE id=%s" % self.doQuote(printer.ident), 422 ] : 423 self.doModify(q) 424 -
pykota/trunk/pykota/version.py
r1325 r1330 22 22 # 23 23 24 __version__ = "1.18alpha 1_unofficial"24 __version__ = "1.18alpha2_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""