| 605 | def getAvoidDuplicateBanners(self, printername) : |
| 606 | """Returns normalized value for avoiding extra banners. """ |
| 607 | try : |
| 608 | avoidduplicatebanners = self.getPrinterOption(printername, "avoidduplicatebanners").upper() |
| 609 | except PyKotaConfigError : |
| 610 | return "NO" |
| 611 | else : |
| 612 | try : |
| 613 | value = int(avoidduplicatebanners) |
| 614 | if value < 0 : |
| 615 | raise ValueError |
| 616 | except ValueError : |
| 617 | if avoidduplicatebanners not in ["YES", "NO"] : |
| 618 | raise PyKotaConfigError, _("Option avoidduplicatebanners only accepts 'yes', 'no', or a positive integer.") |
| 619 | else : |
| 620 | value = avoidduplicatebanners |
| 621 | return value |
| 622 | |