Changeset 2308 for pykota/trunk/pykota/config.py
- Timestamp:
- 06/10/05 22:39:13 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/config.py
r2307 r2308 49 49 def isTrue(self, option) : 50 50 """Returns 1 if option is set to true, else 0.""" 51 if (option is not None) and (option.upper().strip() in ['Y', 'YES', '1', 'ON', 'T', 'TRUE']) : 51 if (option is not None) and (option.strip().upper() in ['Y', 'YES', '1', 'ON', 'T', 'TRUE']) : 52 return 1 53 else : 54 return 0 55 56 def isFalse(self, option) : 57 """Returns 1 if option is set to false, else 0.""" 58 if (option is not None) and (option.strip().upper() in ['N', 'NO', '0', 'OFF', 'F', 'FALSE']) : 52 59 return 1 53 60 else : … … 394 401 395 402 def getDenyDuplicates(self, printername) : 396 """Returns 1 if we want to deny duplicate jobs, else 0."""403 """Returns 1 or a command if we want to deny duplicate jobs, else 0.""" 397 404 try : 398 return self.isTrue(self.getPrinterOption(printername, "denyduplicates"))405 denyduplicates = self.getPrinterOption(printername, "denyduplicates") 399 406 except PyKotaConfigError : 400 407 return 0 408 else : 409 if self.isTrue(denyduplicates) : 410 return 1 411 elif self.isFalse(denyduplicates) : 412 return 0 413 else : 414 # it's a command to run. 415 return denyduplicates 401 416 402 417 def getWinbindSeparator(self) :