Show
Ignore:
Timestamp:
09/01/04 01:29:53 (20 years ago)
Author:
jalet
Message:

Introduction of the new 'onaccountererror' configuration directive.
Small fix for software accounter's return code which can't be None anymore.
Make software and hardware accounting code look similar : will be factorized
later.

Files:
1 modified

Legend:

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

    r1646 r1687  
    2222# 
    2323# $Log$ 
     24# Revision 1.51  2004/08/31 23:29:53  jalet 
     25# Introduction of the new 'onaccountererror' configuration directive. 
     26# Small fix for software accounter's return code which can't be None anymore. 
     27# Make software and hardware accounting code look similar : will be factorized 
     28# later. 
     29# 
    2430# Revision 1.50  2004/07/27 07:07:27  jalet 
    2531# Typo : treshold ==> threshold 
     
    366372            return enforcement     
    367373             
     374    def getPrinterOnAccounterError(self, printername) :     
     375        """Returns what must be done whenever the accounter fails.""" 
     376        validactions = [ "CONTINUE", "STOP" ]      
     377        try : 
     378            action = self.getPrinterOption(printername, "onaccountererror") 
     379        except PyKotaConfigError :     
     380            return "STOP" 
     381        else :     
     382            action = action.upper() 
     383            if action not in validactions : 
     384                raise PyKotaConfigError, _("Option onaccountererror in section %s only supports values in %s") % (printername, str(validactions)) 
     385            return action   
     386             
    368387    def getPrinterPolicy(self, printername) :     
    369388        """Returns the default policy for the current printer."""