From: Christian Herdtweck Date: Wed, 19 Aug 2015 12:39:44 +0000 (+0200) Subject: updated autodoc conf: allow __init__ to show but not __dict__ and others X-Git-Tag: v1.2~112 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=42f682906da4c5388769126467319855d288e0dc;p=pyi2ncommon updated autodoc conf: allow __init__ to show but not __dict__ and others --- diff --git a/doc/conf.py b/doc/conf.py index f06f6d2..875c9d0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -297,7 +297,20 @@ intersphinx_mapping = {'https://docs.python.org/': None} # show doc of class AND of constructor autoclass_content = 'class' # 'both' not needed if special-members is used + # as default flag autodoc_default_flags = ['members', 'special-members', 'undoc-members', 'show-inheritance'] autodoc_member_order = 'bysource' + +# want to keep __init__ members but exclude other special members +def skip_class_members(app, what, name, obj, skip, options): + exclude = name in ('__weakref__', '__dict__', '__module__', '__doc__') \ + and what == 'class' + if exclude: + print('excluding {0}'.format(name)) + return skip or exclude + +def setup(app): + print('running custom setup in conf.py') + app.connect('autodoc-skip-member', skip_class_members)