| 599 | def getStatusStabilizationLoops(self, printername) : |
| 600 | """Returns the number of times the printer must return the 'idle' status to consider it stable.""" |
| 601 | try : |
| 602 | stab = self.getPrinterOption(printername, "statusstabilizationloops") |
| 603 | except PyKotaConfigError : |
| 604 | return None # tells to use hardcoded value |
| 605 | else : |
| 606 | try : |
| 607 | stab = int(stab) |
| 608 | if stab < 1 : |
| 609 | raise ValueError |
| 610 | except (TypeError, ValueError) : |
| 611 | raise PyKotaConfigError, _("Incorrect value %s for the statusstabilizationloops directive in section %s") % (str(stab), printername) |
| 612 | else : |
| 613 | return stab |
| 614 | |
| 615 | def getStatusStabilizationDelay(self, printername) : |
| 616 | """Returns the number of seconds to wait between two checks of the printer's status.""" |
| 617 | try : |
| 618 | stab = self.getPrinterOption(printername, "statusstabilizationdelay") |
| 619 | except PyKotaConfigError : |
| 620 | return None # tells to use hardcoded value |
| 621 | else : |
| 622 | try : |
| 623 | stab = float(stab) |
| 624 | if stab < 0.25 : |
| 625 | raise ValueError |
| 626 | except (TypeError, ValueError) : |
| 627 | raise PyKotaConfigError, _("Incorrect value %s for the statusstabilizationdelay directive in section %s") % (str(stab), printername) |
| 628 | else : |
| 629 | return stab |
| 630 | |