Changeset 1365 for pykota/trunk/pykota/storage.py
- Timestamp:
- 02/26/04 15:18:07 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storage.py
r1364 r1365 22 22 # 23 23 # $Log$ 24 # Revision 1.46 2004/02/26 14:18:07 jalet 25 # Should fix the remaining bugs wrt printers groups and users groups. 26 # 24 27 # Revision 1.45 2004/02/26 10:40:40 jalet 25 28 # Fixed nested printer groups accounting. … … 394 397 self.DateLimit = None 395 398 399 def __getattr__(self, name) : 400 """Delays data retrieval until it's really needed.""" 401 if name == "ParentPrintersGroupPQuota" : 402 self.ParentPrintersGroupPQuota = (self.Group.Exists and self.Printer.Exists and self.parent.getParentPrintersGroupPQuota(self)) or [] 403 return self.ParentPrintersGroupPQuota 404 else : 405 raise AttributeError, name 406 396 407 def setDateLimit(self, datelimit) : 397 408 """Sets the date limit for this quota.""" … … 555 566 for parent in printer.Parents[:] : 556 567 printer.Parents.extend(self.getParentPrinters(parent)) 557 self.tool.logdebug("=== %i ===> %s" % (len(printer.Parents), [p.Name for p in printer.Parents]))558 568 return printer.Parents 559 569 … … 586 596 def getParentPrintersUserPQuota(self, userpquota) : 587 597 """Returns all user print quota on the printer and all its parents recursively.""" 588 upquotas = [ ]598 upquotas = [ ] 589 599 for printer in self.getParentPrinters(userpquota.Printer) : 590 600 upquotas.append(self.getUserPQuota(userpquota.User, printer)) 591 self.tool.logdebug("UPQUOTAS : %i ===> %s" % (len(upquotas), ["%s/%s" % (upq.User.Name, upq.Printer.Name) for upq in upquotas]))592 601 return upquotas 602 603 def getParentPrintersGroupPQuota(self, grouppquota) : 604 """Returns all group print quota on the printer and all its parents recursively.""" 605 gpquotas = [ ] 606 for printer in self.getParentPrinters(grouppquota.Printer) : 607 gpquotas.append(self.getGroupPQuota(grouppquota.Group, printer)) 608 return gpquotas 593 609 594 610 def openConnection(pykotatool) :