Show
Ignore:
Timestamp:
05/25/04 00:45:49 (20 years ago)
Author:
jalet
Message:

New 'enforcement' directive added
Polling loop improvements

Files:
1 modified

Legend:

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

    r1483 r1495  
    2222# 
    2323# $Log$ 
     24# Revision 1.48  2004/05/24 22:45:49  jalet 
     25# New 'enforcement' directive added 
     26# Polling loop improvements 
     27# 
    2428# Revision 1.47  2004/05/18 14:49:20  jalet 
    2529# Big code changes to completely remove the need for "requester" directives, 
     
    343347            return      # No command to launch in the post-hook 
    344348             
     349    def getPrinterEnforcement(self, printername) :     
     350        """Returns if quota enforcement should be strict or laxist for the current printer.""" 
     351        validenforcements = [ "STRICT", "LAXIST" ]      
     352        try : 
     353            enforcement = self.getPrinterOption(printername, "enforcement") 
     354        except PyKotaConfigError :     
     355            return "LAXIST" 
     356        else :     
     357            enforcement = enforcement.upper() 
     358            if enforcement not in validenforcements : 
     359                raise PyKotaConfigError, _("Option enforcement in section %s only supports values in %s") % (printername, str(validenforcements)) 
     360            return enforcement     
     361             
    345362    def getPrinterPolicy(self, printername) :     
    346363        """Returns the default policy for the current printer."""