Changeset 3169
- Timestamp:
- 04/17/07 19:41:37 (18 years ago)
- Location:
- pykota/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r3159 r3169 391 391 self.UserName = self.UserName.split(separator)[-1] 392 392 393 # do we want to lowercase usernames ? 394 if self.config.getUserNameToLower() : 395 self.UserName = self.UserName.lower() 393 # this option is deprecated, and we want to tell people 394 # this is the case. 395 dummy = self.config.getUserNameToLower() 396 if dummy is not None : 397 self.printInfo("Option 'utolower' is deprecated. Please use the 'usernamecase' option instead. Syntax is 'usernamecase: lower|upper|native' and defaults to 'native'.", "error") 398 # Now use the newer and more complete 'usernamecase' directive. 399 casechange = self.config.getUserNameCase() 400 if casechange != "native" : 401 self.UserName = getattr(self.UserName, casechange)() 396 402 397 403 # do we want to strip some prefix off of titles ? -
pykota/trunk/conf/pykota.conf.sample
r3162 r3169 329 329 330 330 331 # Should we force usernames to be all lowercasewhen printing ?332 # Default is No.331 # Should we modify usernames when printing ? 332 # Default is native, meaning usernames won't be modified. 333 333 # This is a [global] option only. 334 # Some people reported that WinXP sends mixed case usernames 335 # setting 'utolower: Yes' solves the problem.336 # Of course you have to use lowercase only when adding337 # users with edpykota, because ALL database accesses are334 # Some people reported that WinXP sends mixed case usernames, 335 # setting usernamecase to 'upper' or 'lower' solves the problem. 336 # Of course you have to use uppercase or lowercase only when managing 337 # users with pkusers, because ALL database accesses are 338 338 # still case sensitive. 339 339 # 340 # If u tolower is Yes, the usernames received from the printing341 # system is converted to lowercase at the start of printing,342 # BUT ONLY when printing.343 # 344 # If u tolower is No, which is the default, strict case checking340 # If usernamecase is 'upper' or 'lower', the usernames received 341 # from the printing system are converted to uppercase or lowercase, 342 # respectively, at the start of printing, BUT ONLY when printing. 343 # 344 # If usernamecase is 'native', which is the default, strict case checking 345 345 # is done, this means that users 'Jerome' and 'jerome' are 346 346 # different. Printer and groups names are ALWAYS case sensitive. 347 347 # 348 utolower: No 348 # usernamecase : upper 349 # usernamecase : lower 350 usernamecase: native 349 351 350 352 -
pykota/trunk/pykota/config.py
r3162 r3169 77 77 except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) : 78 78 if ignore : 79 return 79 return None 80 80 else : 81 81 raise PyKotaConfigError, _("Option %s not found in section global of %s") % (option, self.filename) … … 522 522 523 523 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 526 536 527 537 def getRejectUnknown(self) :