409 | | if self.tool.matchString(printername, [ printerpattern ]) : |
410 | | printer = StoragePrinter(self, printername) |
411 | | printer.ident = printerid |
412 | | printer.PricePerJob = float(fields.get("pykotaPricePerJob")[0] or 0.0) |
413 | | printer.PricePerPage = float(fields.get("pykotaPricePerPage")[0] or 0.0) |
414 | | printer.LastJob = self.getPrinterLastJob(printer) |
415 | | printer.Exists = 1 |
416 | | printers.append(printer) |
417 | | self.cacheEntry("PRINTERS", printer.Name, printer) |
| 412 | printer = StoragePrinter(self, printername) |
| 413 | printer.ident = printerid |
| 414 | printer.PricePerJob = float(fields.get("pykotaPricePerJob")[0] or 0.0) |
| 415 | printer.PricePerPage = float(fields.get("pykotaPricePerPage")[0] or 0.0) |
| 416 | printer.LastJob = self.getPrinterLastJob(printer) |
| 417 | printer.Exists = 1 |
| 418 | printers.append(printer) |
| 419 | self.cacheEntry("PRINTERS", printer.Name, printer) |
426 | | user = self.getUser(fields["pykotaUserName"][0]) |
427 | | if (names is None) or self.tool.matchString(user.Name, names) : |
428 | | userpquota = StorageUserPQuota(self, user, printer) |
429 | | userpquota.ident = userquotaid |
430 | | userpquota.PageCounter = int(fields.get("pykotaPageCounter")[0] or 0) |
431 | | userpquota.LifePageCounter = int(fields.get("pykotaLifePageCounter")[0] or 0) |
432 | | userpquota.SoftLimit = fields.get("pykotaSoftLimit") |
433 | | if userpquota.SoftLimit is not None : |
434 | | if userpquota.SoftLimit[0].upper() == "NONE" : |
435 | | userpquota.SoftLimit = None |
436 | | else : |
437 | | userpquota.SoftLimit = int(userpquota.SoftLimit[0]) |
438 | | userpquota.HardLimit = fields.get("pykotaHardLimit") |
439 | | if userpquota.HardLimit is not None : |
440 | | if userpquota.HardLimit[0].upper() == "NONE" : |
441 | | userpquota.HardLimit = None |
442 | | elif userpquota.HardLimit is not None : |
443 | | userpquota.HardLimit = int(userpquota.HardLimit[0]) |
444 | | userpquota.DateLimit = fields.get("pykotaDateLimit") |
445 | | if userpquota.DateLimit is not None : |
446 | | if userpquota.DateLimit[0].upper() == "NONE" : |
447 | | userpquota.DateLimit = None |
448 | | else : |
449 | | userpquota.DateLimit = userpquota.DateLimit[0] |
450 | | userpquota.Exists = 1 |
451 | | usersandquotas.append((user, userpquota)) |
452 | | self.cacheEntry("USERPQUOTAS", "%s@%s" % (user.Name, printer.Name), userpquota) |
| 428 | user = self.getUser(fields.get("pykotaUserName")[0]) |
| 429 | userpquota = StorageUserPQuota(self, user, printer) |
| 430 | userpquota.ident = userquotaid |
| 431 | userpquota.PageCounter = int(fields.get("pykotaPageCounter")[0] or 0) |
| 432 | userpquota.LifePageCounter = int(fields.get("pykotaLifePageCounter")[0] or 0) |
| 433 | userpquota.SoftLimit = fields.get("pykotaSoftLimit") |
| 434 | if userpquota.SoftLimit is not None : |
| 435 | if userpquota.SoftLimit[0].upper() == "NONE" : |
| 436 | userpquota.SoftLimit = None |
| 437 | else : |
| 438 | userpquota.SoftLimit = int(userpquota.SoftLimit[0]) |
| 439 | userpquota.HardLimit = fields.get("pykotaHardLimit") |
| 440 | if userpquota.HardLimit is not None : |
| 441 | if userpquota.HardLimit[0].upper() == "NONE" : |
| 442 | userpquota.HardLimit = None |
| 443 | elif userpquota.HardLimit is not None : |
| 444 | userpquota.HardLimit = int(userpquota.HardLimit[0]) |
| 445 | userpquota.DateLimit = fields.get("pykotaDateLimit") |
| 446 | if userpquota.DateLimit is not None : |
| 447 | if userpquota.DateLimit[0].upper() == "NONE" : |
| 448 | userpquota.DateLimit = None |
| 449 | else : |
| 450 | userpquota.DateLimit = userpquota.DateLimit[0] |
| 451 | userpquota.Exists = 1 |
| 452 | usersandquotas.append((user, userpquota)) |
| 453 | self.cacheEntry("USERPQUOTAS", "%s@%s" % (user.Name, printer.Name), userpquota) |