Show
Ignore:
Timestamp:
02/14/06 16:18:45 (18 years ago)
Author:
jerome
Message:

Added the 'duplicatesdelay' and 'balancezero' directives.

Files:
1 modified

Legend:

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

    r2635 r2692  
    439439            raise PyKotaConfigError, _("Invalid poor man's threshold %s") % pm 
    440440             
     441    def getBalanceZero(self) :     
     442        """Returns the value of the zero for balance limitation.""" 
     443        try : 
     444            bz = self.getGlobalOption("balancezero") 
     445        except PyKotaConfigError :     
     446            bz = 0.0    # default value, zero is 0.0 
     447        try : 
     448            return float(bz) 
     449        except (TypeError, ValueError) :     
     450            raise PyKotaConfigError, _("Invalid balancezero value %s") % bz 
     451             
    441452    def getPoorWarn(self) :     
    442453        """Returns the poor man's warning message.""" 
     
    516527                # it's a command to run. 
    517528                return denyduplicates 
     529                 
     530    def getDuplicatesDelay(self, printername) :           
     531        """Returns the number of seconds after which two identical jobs are not considered a duplicate anymore.""" 
     532        try :  
     533            duplicatesdelay = self.getPrinterOption(printername, "duplicatesdelay") 
     534        except PyKotaConfigError :     
     535            return 0 
     536        else :     
     537            try : 
     538                return int(duplicatesdelay) 
     539            except (TypeError, ValueError) : 
     540                raise PyKotaConfigError, _("Incorrect value %s for the duplicatesdelay directive in section %s") % (str(duplicatesdelay), printername) 
    518541         
    519542    def getWinbindSeparator(self) :