Show
Ignore:
Timestamp:
11/29/03 21:06:20 (20 years ago)
Author:
jalet
Message:

Added 'utolower' configuration option to convert all usernames to
lowercase when printing. All database accesses are still and will
remain case sensitive though.

Files:
1 modified

Legend:

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

    r1192 r1227  
    2222# 
    2323# $Log$ 
     24# Revision 1.41  2003/11/29 20:06:20  jalet 
     25# Added 'utolower' configuration option to convert all usernames to 
     26# lowercase when printing. All database accesses are still and will 
     27# remain case sensitive though. 
     28# 
    2429# Revision 1.40  2003/11/18 23:43:12  jalet 
    2530# Mailto can be any external command now, as usual. 
     
    197202        self.config = ConfigParser.ConfigParser() 
    198203        self.config.read([self.filename]) 
     204             
     205    def isTrue(self, option) :         
     206        """Returns 1 if option is set to true, else 0.""" 
     207        if (option is not None) and (option.upper().strip() in ['Y', 'YES', '1', 'ON', 'T', 'TRUE']) : 
     208            return 1 
     209        else :     
     210            return 0 
    199211                         
    200212    def getPrinterNames(self) :     
     
    439451    def getDebug(self) :           
    440452        """Returns 1 if debugging is activated, else 0.""" 
    441         debug = self.getGlobalOption("debug", ignore=1) 
    442         if (debug is not None) and (debug.upper().strip() in ['Y', 'YES', '1', 'ON', 'O']) : 
    443             return 1 
    444         else :     
    445             return 0 
     453        return self.isTrue(self.getGlobalOption("debug", ignore=1)) 
    446454             
    447455    def getCaching(self) :           
    448456        """Returns 1 if database caching is enabled, else 0.""" 
    449         caching = self.getGlobalOption("storagecaching", ignore=1) 
    450         if (caching is not None) and (caching.upper().strip() in ['Y', 'YES', '1', 'ON', 'O']) : 
    451             return 1 
    452         else :     
    453             return 0 
     457        return self.isTrue(self.getGlobalOption("storagecaching", ignore=1)) 
    454458             
    455459    def getDisableHistory(self) :           
    456460        """Returns 1 if we want to disable history, else 0.""" 
    457         disablehistory = self.getGlobalOption("disablehistory", ignore=1) 
    458         if (disablehistory is not None) and (disablehistory.upper().strip() in ['Y', 'YES', '1', 'ON', 'O']) : 
    459             return 1 
    460         else :     
    461             return 0 
     461        return self.isTrue(self.getGlobalOption("disablehistory", ignore=1)) 
     462             
     463    def getUserNameToLower(self) :           
     464        """Returns 1 if we want to convert usernames to lowercase when printing, else 0.""" 
     465        return self.isTrue(self.getGlobalOption("utolower", ignore=1))