Changeset 3169 for pykota/trunk/pykota

Show
Ignore:
Timestamp:
04/17/07 19:41:37 (17 years ago)
Author:
jerome
Message:

Finish implementation of the usernamecase directive.

Files:
1 modified

Legend:

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

    r3162 r3169  
    7777        except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) :     
    7878            if ignore : 
    79                 return 
     79                return None 
    8080            else : 
    8181                raise PyKotaConfigError, _("Option %s not found in section global of %s") % (option, self.filename) 
     
    522522             
    523523    def getUserNameToLower(self) :           
    524         """Returns True if we want to convert usernames to lowercase when printing, else False.""" 
    525         return self.isTrue(self.getGlobalOption("utolower", ignore=1)) 
     524        """Deprecated.""" 
     525        return self.getGlobalOption("utolower", ignore=1) 
     526         
     527    def getUserNameCase(self) : 
     528        """Returns value for user name case: upper, lower or native""" 
     529        validvalues = [ "upper", "lower", "native" ] 
     530        value = self.getGlobalOption("usernamecase", ignore=1).strip().lower() 
     531        if value is None : 
     532            value = "native" 
     533        if value not in validvalues : 
     534            raise PyKotaConfigError, _("Option usernamecase only supports values in %s") % str(validvalues) 
     535        return value 
    526536         
    527537    def getRejectUnknown(self) :