Message132385
| Author |
weeble |
| Recipients |
weeble |
| Date |
2011年03月28日.08:43:48 |
| SpamBayes Score |
2.0722554e-07 |
| Marked as misclassified |
No |
| Message-id |
<1301301829.71.0.0713641718569.issue11699@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The docs for optparse say this:
OptionParser.get_option_group(opt_str)
Return, if defined, the OptionGroup that has the title or the long description equals to opt_str
After failing to get this to work at all, I looked at the implementation, and the documentation is completely wrong. The method takes an option string, like '-o' or '--option' and returns the option group that it belongs to.
Personally, I would much prefer the function to do what the documentation describes, i.e. find the option group with the given name, but I guess it's far too late for that. The scenario I'm in is that I'm writing a plugin for an existing tool which provides access to its OptionParser to add new options, but doesn't provide references to any of the groups that are already created.
It looks like this documentation was added recently:
http://bugs.python.org/issue1665333 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年03月28日 08:43:49 | weeble | set | recipients:
+ weeble |
| 2011年03月28日 08:43:49 | weeble | set | messageid: <1301301829.71.0.0713641718569.issue11699@psf.upfronthosting.co.za> |
| 2011年03月28日 08:43:48 | weeble | link | issue11699 messages |
| 2011年03月28日 08:43:48 | weeble | create |
|