Changeset 1914 for pykota/trunk/pykota/config.py
- Timestamp:
- 11/15/04 16:14:06 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/config.py
r1875 r1914 22 22 # 23 23 # $Log$ 24 # Revision 1.55 2004/11/15 15:14:06 jalet 25 # Preliminary integration of Matt's patch for banners. 26 # 24 27 # Revision 1.54 2004/10/25 14:12:25 jalet 25 28 # For URGENT legal reasons (Italy), a new "privacy" directive was added to pykota.conf … … 490 493 gd = self.getPrinterOption(printername, "gracedelay") 491 494 except PyKotaConfigError : 492 gd = 7 495 gd = 7 # default value of 7 days 493 496 try : 494 497 return int(gd) … … 501 504 pm = self.getGlobalOption("poorman") 502 505 except PyKotaConfigError : 503 pm = 1.0 506 pm = 1.0 # default value of 1 unit 504 507 try : 505 508 return float(pm) … … 555 558 """Returns the winbind separator's value if it is set, else None.""" 556 559 return self.getGlobalOption("winbind_separator", ignore=1) 560 561 def getAccountBanner(self, printername) : 562 """Returns which banner(s) to account for: NONE, BOTH, STARTING, ENDING.""" 563 validvalues = [ "NONE", "BOTH", "STARTING", "ENDING" ] 564 try : 565 value = self.getPrinterOption(printername, "accountbanner") 566 except PyKotaConfigError : 567 return "BOTH" # Default value of BOTH 568 else : 569 value = value.upper() 570 if value not in validvalues : 571 raise PyKotaConfigError, _("Option onaccountererror in section %s only supports values in %s") % (printername, str(validvalues)) 572 return value 573 574 def getStartingBanner(self, printername) : 575 """Returns the startingbanner value if set, else None.""" 576 try : 577 return self.getPrinterOption(printername, "startingbanner") 578 except PyKotaConfigError : 579 return None 580 581 def getEndingBanner(self, printername) : 582 """Returns the endingbanner value if set, else None.""" 583 try : 584 return self.getPrinterOption(printername, "endingbanner") 585 except PyKotaConfigError : 586 return None