110 | | self.parent.beginTransaction() |
111 | | try : |
112 | | self.parent.deleteUser(self) |
113 | | except PyKotaStorageError, msg : |
114 | | self.parent.rollbackTransaction() |
115 | | raise PyKotaStorageError, msg |
116 | | else : |
117 | | self.parent.commitTransaction() |
118 | | self.parent.flushEntry("USERS", self.Name) |
119 | | if self.parent.usecache : |
120 | | for (k, v) in self.parent.caches["USERPQUOTAS"].items() : |
121 | | if v.User.Name == self.Name : |
122 | | self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (v.User.Name, v.Printer.Name)) |
123 | | self.Exists = 0 |
| 110 | self.parent.deleteUser(self) |
| 111 | self.parent.flushEntry("USERS", self.Name) |
| 112 | if self.parent.usecache : |
| 113 | for (k, v) in self.parent.caches["USERPQUOTAS"].items() : |
| 114 | if v.User.Name == self.Name : |
| 115 | self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (v.User.Name, v.Printer.Name)) |
| 116 | self.Exists = False |
| 117 | self.isDirty = False |
154 | | self.parent.beginTransaction() |
155 | | try : |
156 | | self.parent.deleteGroup(self) |
157 | | except PyKotaStorageError, msg : |
158 | | self.parent.rollbackTransaction() |
159 | | raise PyKotaStorageError, msg |
160 | | else : |
161 | | self.parent.commitTransaction() |
162 | | self.parent.flushEntry("GROUPS", self.Name) |
163 | | if self.parent.usecache : |
164 | | for (k, v) in self.parent.caches["GROUPPQUOTAS"].items() : |
165 | | if v.Group.Name == self.Name : |
166 | | self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (v.Group.Name, v.Printer.Name)) |
167 | | self.Exists = 0 |
| 148 | self.parent.deleteGroup(self) |
| 149 | self.parent.flushEntry("GROUPS", self.Name) |
| 150 | if self.parent.usecache : |
| 151 | for (k, v) in self.parent.caches["GROUPPQUOTAS"].items() : |
| 152 | if v.Group.Name == self.Name : |
| 153 | self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (v.Group.Name, v.Printer.Name)) |
| 154 | self.Exists = False |
| 155 | self.isDirty = False |
228 | | self.parent.beginTransaction() |
229 | | try : |
230 | | self.parent.deletePrinter(self) |
231 | | except PyKotaStorageError, msg : |
232 | | self.parent.rollbackTransaction() |
233 | | raise PyKotaStorageError, msg |
234 | | else : |
235 | | self.parent.commitTransaction() |
236 | | self.parent.flushEntry("PRINTERS", self.Name) |
237 | | if self.parent.usecache : |
238 | | for (k, v) in self.parent.caches["USERPQUOTAS"].items() : |
239 | | if v.Printer.Name == self.Name : |
240 | | self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (v.User.Name, v.Printer.Name)) |
241 | | for (k, v) in self.parent.caches["GROUPPQUOTAS"].items() : |
242 | | if v.Printer.Name == self.Name : |
243 | | self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (v.Group.Name, v.Printer.Name)) |
244 | | self.isDirty = False |
245 | | self.Exists = False |
| 216 | self.parent.deletePrinter(self) |
| 217 | self.parent.flushEntry("PRINTERS", self.Name) |
| 218 | if self.parent.usecache : |
| 219 | for (k, v) in self.parent.caches["USERPQUOTAS"].items() : |
| 220 | if v.Printer.Name == self.Name : |
| 221 | self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (v.User.Name, v.Printer.Name)) |
| 222 | for (k, v) in self.parent.caches["GROUPPQUOTAS"].items() : |
| 223 | if v.Printer.Name == self.Name : |
| 224 | self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (v.Group.Name, v.Printer.Name)) |
| 225 | self.Exists = False |
| 226 | self.isDirty = False |
346 | | self.parent.beginTransaction() |
347 | | try : |
348 | | self.parent.deleteUserPQuota(self) |
349 | | except PyKotaStorageError, msg : |
350 | | self.parent.rollbackTransaction() |
351 | | raise PyKotaStorageError, msg |
352 | | else : |
353 | | self.parent.commitTransaction() |
354 | | if self.parent.usecache : |
355 | | self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (self.User.Name, self.Printer.Name)) |
356 | | self.Exists = 0 |
| 327 | self.parent.deleteUserPQuota(self) |
| 328 | if self.parent.usecache : |
| 329 | self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (self.User.Name, self.Printer.Name)) |
| 330 | self.Exists = False |
| 331 | self.isDirty = False |
381 | | self.parent.beginTransaction() |
382 | | try : |
383 | | for user in self.parent.getGroupMembers(self.Group) : |
384 | | uq = self.parent.getUserPQuota(user, self.Printer) |
385 | | uq.reset() |
386 | | uq.save() |
387 | | except PyKotaStorageError, msg : |
388 | | self.parent.rollbackTransaction() |
389 | | raise PyKotaStorageError, msg |
390 | | else : |
391 | | self.parent.commitTransaction() |
| 356 | for user in self.parent.getGroupMembers(self.Group) : |
| 357 | uq = self.parent.getUserPQuota(user, self.Printer) |
| 358 | uq.reset() |
| 359 | uq.save() |
398 | | self.parent.beginTransaction() |
399 | | try : |
400 | | for user in self.parent.getGroupMembers(self.Group) : |
401 | | uq = self.parent.getUserPQuota(user, self.Printer) |
402 | | uq.hardreset() |
403 | | uq.save() |
404 | | except PyKotaStorageError, msg : |
405 | | self.parent.rollbackTransaction() |
406 | | raise PyKotaStorageError, msg |
407 | | else : |
408 | | self.parent.commitTransaction() |
| 366 | for user in self.parent.getGroupMembers(self.Group) : |
| 367 | uq = self.parent.getUserPQuota(user, self.Printer) |
| 368 | uq.hardreset() |
| 369 | uq.save() |
433 | | self.parent.beginTransaction() |
434 | | try : |
435 | | self.parent.deleteGroupPQuota(self) |
436 | | except PyKotaStorageError, msg : |
437 | | self.parent.rollbackTransaction() |
438 | | raise PyKotaStorageError, msg |
439 | | else : |
440 | | self.parent.commitTransaction() |
441 | | if self.parent.usecache : |
442 | | self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (self.Group.Name, self.Printer.Name)) |
443 | | self.Exists = 0 |
| 394 | self.parent.deleteGroupPQuota(self) |
| 395 | if self.parent.usecache : |
| 396 | self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (self.Group.Name, self.Printer.Name)) |
| 397 | self.Exists = False |
| 398 | self.isDirty = False |