| 335 | |
| 336 | def getPoorMan(self) : |
| 337 | """Returns the poor man's treshold.""" |
| 338 | try : |
| 339 | pm = self.getGlobalOption("poorman") |
| 340 | except PyKotaConfigError : |
| 341 | pm = 1.0 |
| 342 | try : |
| 343 | return float(pm) |
| 344 | except (TypeError, ValueError) : |
| 345 | raise PyKotaConfigError, _("Invalid poor man's treshold %s") % pm |
| 346 | |
| 347 | def getPoorWarn(self) : |
| 348 | """Returns the poor man's warning message.""" |
| 349 | try : |
| 350 | return self.getGlobalOption("poorwarn") |
| 351 | except PyKotaConfigError : |
| 352 | return _("Your Print Quota account balance is Low.\nSoon you'll not be allowed to print anymore.\nPlease contact the Print Quota Administrator to solve the problem.") |
| 353 | |
| 354 | def getHardWarn(self, printer) : |
| 355 | """Returns the hard limit error message.""" |
| 356 | try : |
| 357 | return self.getPrinterOption(printer, "hardwarn") |
| 358 | except PyKotaConfigError : |
| 359 | return _("You are not allowed to print anymore because\nyour Print Quota is exceeded on printer %s.") % printer |
| 360 | |
| 361 | def getSoftWarn(self, printer) : |
| 362 | """Returns the soft limit error message.""" |
| 363 | try : |
| 364 | return self.getPrinterOption(printer, "softwarn") |
| 365 | except PyKotaConfigError : |
| 366 | return _("You will soon be forbidden to print anymore because\nyour Print Quota is almost reached on printer %s.") % printer |