Message99233
Cmd currently has undocumented support for using the docstrings of 'do_' methods as the documentation for those methods. This is a very convenient facility, except that it leads to documentation being printed with a lot of leading whitespace.
I propose to enhance the docstring support to strip the leading whitespace from the docstring, and to document this facility. The proposed stripping algorithm is to strip a number of characters equal to the whitespace on the first non-blank line of the docstring. This means that existing docstrings, which will typically start right after the first """, will be displayed as they were previously, but that a docstring can be formatted by starting the documentation on a new line after the """, and whitespace will be properly stripped.
Patch attached with test and documentation update. |
|
Date |
User |
Action |
Args |
2010-02-11 18:57:22 | r.david.murray | set | recipients:
+ r.david.murray |
2010-02-11 18:57:22 | r.david.murray | set | messageid: <1265914642.07.0.496715269242.issue7913@psf.upfronthosting.co.za> |
2010-02-11 18:57:20 | r.david.murray | link | issue7913 messages |
2010-02-11 18:57:20 | r.david.murray | create | |
|