Comment #8 on issue 1735 by pekka.klarck: String: Keywords to convert
strings to upper/lower/title case
http://code.google.com/p/robotframework/issues/detail?id=1735
How to convert 'ALL UPPER' to title case is actually a very good question.
As you pointed out, `'ALL UPPER'.title() == 'All Upper'` which may not be
desirable when dealing with acronyms like 'UK' or 'HTML'. For this reason
Robot doesn't itself use title() when it creates keyword names but instead
converts all first letters to upper case. We have the following options:
1) Use title() and be OK with 'convert XML to HTML' to be converted
to 'Convert Xml To Html'. As you pointed out, this ought to be documented.
2) Implement a custom solution that only upper cases first letter.
Unfortunately cannot directly use utils.printable_name because it
normalizes spaces. This would also be inconsistent with Should Be Titlecase
keyword that considers 'Convert XML To HTML' not to be titlecase.
3) Make it possible to specify should the keyword behave like 1) or 2).
This is probably an overkill solution.
4) Don't implement Convert To Titlecase at all. Nobody has requested it and
I doubt how useful it would actually be. If there are actual needs later,
we can always add it then.
I'm stating to think the last solution is the best one. At least it is the
easiest.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
---
You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.