[issue7913] Enhance Cmd support for docstrings and document it.

2017-03-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Can you create a pull request David?

--
nosy: +serhiy.storchaka
versions: +Python 3.7 -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7913] Enhance Cmd support for docstrings and document it.

2011-03-20 Thread Daniel Urban

Daniel Urban urban.dani...@gmail.com added the comment:

inspect.cleandoc (which is also used by inspect.getdoc and pydoc.getdoc) seems 
to do a similar thing.  Maybe that could be used for this?

--
nosy: +durban

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7913
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7913] Enhance Cmd support for docstrings and document it.

2011-03-20 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

You can apply the patch (which includes tests) and edit the code of cmd.py to 
use cleandoc.

--
versions: +Python 3.3 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7913
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7913] Enhance Cmd support for docstrings and document it.

2010-03-27 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Hello

This would be a nice improvement. This weakness is indeed mentioned on PyMotW.

How about using textwrap.dedent?

Regards

--
nosy: +merwok

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7913
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7913] Enhance Cmd support for docstrings and document it.

2010-03-27 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

The problem with using textwrap is that you'd have to identify paragraph 
boundaries and example code to avoid messing up the meaning of the doc string.  
At that point, one might as well go for full ReST markup parsing, and I don't 
think that is appropriate :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7913
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7913] Enhance Cmd support for docstrings and document it.

2010-03-27 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 The problem with using textwrap is that you'd have to identify paragraph 
 boundaries
 and example code to avoid messing up the meaning of the doc string.

I thought dedent just worked. Can you provide a simple example to help 
me understand this problem?

Does this help:
http://code.activestate.com/recipes/358228-extend-textwraptextwrapper-to-handle-multiple-para/

Regards

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7913
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7913] Enhance Cmd support for docstrings and document it.

2010-02-11 Thread R. David Murray

New submission from R. David Murray rdmur...@bitdance.com:

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.

--
components: Library (Lib)
files: cmd_doctest_enhancement.patch
keywords: patch
messages: 99233
nosy: r.david.murray
priority: normal
severity: normal
stage: patch review
status: open
title: Enhance Cmd support for docstrings and document it.
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file16213/cmd_doctest_enhancement.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7913
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com