Issue1715
Created on 2007-12-31 23:52 by gustavo, last changed 2008-01-21 21:06 by georg.brandl.
|
msg59067 - (view) |
Author: Gustavo J. A. M. Carneiro (gustavo) |
Date: 2007-12-31 23:52 |
|
Often python extension modules define submodules like this:
static PyObject *
initfoo_xpto(void)
{
PyObject *m;
m = Py_InitModule3("foo.xpto", foo_xpto_functions, NULL);
[...]
return m;
}
PyMODINIT_FUNC
initfoo(void)
{
PyObject *m;
PyObject *submodule;
m = Py_InitModule3("foo", foo_functions, NULL);
[...]
submodule = initfoo_xpto();
Py_INCREF(submodule);
PyModule_AddObject(m, "xpto", submodule);
}
Unfortunately pydoc does not list these submodules. Attached patch
fixes it.
|
|
msg59399 - (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2008-01-06 17:46 |
|
This patch duplicates entries for "package contents" and "submodules";
this is not good. (E.g. for help(email):
NAME
email - A package for parsing, handling, and generating email messages.
FILE
/home/gbr/devel/python/Lib/email/__init__.py
PACKAGE CONTENTS
_parseaddr
base64mime
charset
encoders
errors
feedparser
generator
header
iterators
message
mime (package)
parser
quoprimime
test (package)
utils
SUBMODULES
_parseaddr
base64mime
charset
email
encoders
errors
feedparser
generator
header
iterators
message
mime
parser
quoprimime
sys
utils
)
|
|
msg61307 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2008-01-20 15:42 |
|
This should be a better patch, although it only applies to the text
formatter of pydoc, not the HTML one (I'm too lazy for this :-)).
|
|
msg61408 - (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2008-01-21 16:44 |
|
The patch only amends TextDoc -- what about HtmlDoc?
|
|
msg61446 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2008-01-21 20:52 |
|
Actually, HtmlDoc already lists all module members in the inspected
module (regardless of whether they are modules imported from outside or
submodules defined inline). You can try it with the updated pydocfodder:
>>> import pydoc
>>> from test import pydocfodder
>>> pydoc.writedoc(pydocfodder)
wrote test.pydocfodder.html
... and check that test.pydocfodder.html contains a reference to
test.pydocfodder.submodule.
|
|
msg61449 - (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2008-01-21 21:06 |
|
Well, I believe you. :)
Committed r60178.
|
|
| Date |
User |
Action |
Args |
| 2008-01-21 21:06:03 | georg.brandl | set | status: open -> closed resolution: accepted messages:
+ msg61449 |
| 2008-01-21 20:52:54 | pitrou | set | messages:
+ msg61446 |
| 2008-01-21 16:44:38 | georg.brandl | set | messages:
+ msg61408 |
| 2008-01-20 15:42:22 | pitrou | set | files:
+ pydocsubmodules.patch nosy:
+ pitrou messages:
+ msg61307 |
| 2008-01-06 17:46:32 | georg.brandl | set | messages:
+ msg59399 |
| 2008-01-01 14:46:53 | christian.heimes | set | priority: normal assignee: georg.brandl keywords:
+ patch nosy:
+ georg.brandl |
| 2007-12-31 23:52:12 | gustavo | create | |
|