diff options
| author | Georg Brandl <georg@python.org> | 2008-12-15 12:49:40 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2008-12-15 12:49:40 +0100 |
| commit | bf841f36c1265a31ad82c1f8c4bceac238d3081f (patch) | |
| tree | b2b495675f48a3e1def1c94d841d0ce2614ce47e /sphinx/ext | |
| parent | 3fe753f5452ff23031f3bc6440281a02bb83309d (diff) | |
| download | sphinx-bf841f36c1265a31ad82c1f8c4bceac238d3081f.tar.gz | |
The ``autodoc_skip_member`` event now also gets to decide
whether to skip members whose name starts with underscores.
Previously, these members were always automatically skipped.
Therefore, if you handle this event, add something like this
to your event handler to restore the old behavior::
if name.startswith('_'):
return True
Diffstat (limited to 'sphinx/ext')
| -rw-r--r-- | sphinx/ext/autodoc.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index ddaba04c..6b8da386 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -525,14 +525,15 @@ class RstGenerator(object): all_members = sorted(todoc.__dict__.iteritems()) else: all_members = [(mname, getattr(todoc, mname)) for mname in members] + for (membername, member) in all_members: - # ignore members whose name starts with _ by default if _all and membername.startswith('_'): - continue - - # ignore undocumented members if :undoc-members: is not given - doc = getattr(member, '__doc__', None) - skip = not self.options.undoc_members and not doc + # ignore members whose name starts with _ by default + skip = True + else: + # ignore undocumented members if :undoc-members: is not given + doc = getattr(member, '__doc__', None) + skip = not self.options.undoc_members and not doc # give the user a chance to decide whether this member should be skipped if self.env.app: # let extensions preprocess docstrings |
