Changeset 2739
- Timestamp:
- 02/21/06 17:26:04 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/edpykota
r2738 r2739 159 159 suffix = (options["groups"] and "Group") or "User" 160 160 printernames = options["printer"].split(",") 161 if not names :162 names = ["*"]163 (printers, entries, pqentries) = getattr(self.storage, "getPrinters%ssAndPQuotas" % suffix)(printernames, names)164 161 165 162 if options["delete"] : 166 163 self.display("%s...\n" % _("Deletion")) 167 nbtotal = len(pqentries) 164 printers = self.storage.getMatchingPrinters(options["printer"]) 165 entries = getattr(self.storage, "getMatching%ss" % suffix)(",".join(names)) 166 nbtotal = len(entries) * len(printers) 168 167 i = 0 169 for (pqkey, pqentry) in pqentries.items() : 170 if pqentry.Exists : 171 pqentry.delete() 172 i += 1 173 percent = 100.0 * float(i) / float(nbtotal) 174 self.display("\r%.02f%%" % percent) 168 for printer in printers : 169 for entry in entries : 170 pqentry = getattr(self.storage, "get%sPQuota" % suffix)(entry, printer) 171 if pqentry.Exists : 172 pqentry.delete() 173 i += 1 174 percent = 100.0 * float(i) / float(nbtotal) 175 self.display("\r%.02f%%" % percent) 175 176 else : 177 if not names : 178 names = ["*"] 179 (printers, entries, pqentries) = getattr(self.storage, "getPrinters%ssAndPQuotas" % suffix)(printernames, names) 176 180 skipexisting = options["skipexisting"] 177 181 if options["add"] :