Show
Ignore:
Timestamp:
03/30/07 22:59:54 (17 years ago)
Author:
matt
Message:

Allow configuration to avoid printing banner pages for consecutive jobs for the same user on the same printer

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/config.py

    r3133 r3158  
    603603            return value   
    604604 
     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 
    605623    def getStartingBanner(self, printername) : 
    606624        """Returns the startingbanner value if set, else None."""