Changeset 1227 for pykota/trunk/pykota/config.py
- Timestamp:
- 11/29/03 21:06:20 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/config.py
r1192 r1227 22 22 # 23 23 # $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 # 24 29 # Revision 1.40 2003/11/18 23:43:12 jalet 25 30 # Mailto can be any external command now, as usual. … … 197 202 self.config = ConfigParser.ConfigParser() 198 203 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 199 211 200 212 def getPrinterNames(self) : … … 439 451 def getDebug(self) : 440 452 """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)) 446 454 447 455 def getCaching(self) : 448 456 """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)) 454 458 455 459 def getDisableHistory(self) : 456 460 """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 1460 else :461 return 0461 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))