Show
Ignore:
Timestamp:
05/28/03 01:00:21 (21 years ago)
Author:
jalet
Message:

Big rewrite of external accounting methods.
Should work well now.

Files:
1 modified

Legend:

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

    r980 r1000  
    2121# 
    2222# $Log$ 
     23# Revision 1.27  2003/05/27 23:00:21  jalet 
     24# Big rewrite of external accounting methods. 
     25# Should work well now. 
     26# 
    2327# Revision 1.26  2003/04/30 19:53:58  jalet 
    2428# 1.05 
     
    205209        validaccounters = [ "querying", "stupid", "external" ]      
    206210        try : 
    207             fullaccounter = self.getPrinterOption(printer, "accounter").strip().lower() 
     211            fullaccounter = self.getPrinterOption(printer, "accounter").strip() 
    208212        except PyKotaConfigError :     
    209213            fullaccounter = "querying" 
    210         if fullaccounter.startswith("external") :     
     214        if fullaccounter.lower().startswith("external") :     
    211215            try : 
    212216                (accounter, args) = [x.strip() for x in fullaccounter.split('(', 1)] 
     
    217221            if not args : 
    218222                raise PyKotaConfigError, _("Invalid external accounter %s for printer %s") % (fullaccounter, printer) 
    219             return (accounter, args)     
    220         elif fullaccounter not in validaccounters : 
     223            return (accounter.lower(), args)     
     224        elif fullaccounter.lower() not in validaccounters : 
    221225            raise PyKotaConfigError, _("Option accounter in section %s only supports values in %s") % (printer, str(validaccounters)) 
    222226        else :     
    223             return (fullaccounter, None) 
     227            return (fullaccounter.lower(), None) 
    224228         
    225229    def getRequesterBackend(self, printer) :     
     
    242246                raise PyKotaConfigError, _("Invalid requester %s for printer %s") % (fullrequester, printer) 
    243247            validrequesters = [ "snmp", "external" ] # TODO : add more requesters 
     248            requester = requester.lower() 
    244249            if requester not in validrequesters : 
    245250                raise PyKotaConfigError, _("Option requester for printer %s only supports values in %s") % (printer, str(validrequesters))