Skip to content

Features/testing dry hack #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,15 @@
# texinfo_no_detailmenu = False


autodoc_member_order = 'bysource'

import attr

def process_signature(app, what, name, obj, options, signature,
return_annotation):
if isinstance(obj, attr._make.Attribute):
obj.__class__.__repr__ = lambda *a, **k: None

def maybe_skip_member(app, what, name, obj, skip, options):
# print (what, name, obj, skip)
if type(obj) == property:
Expand All @@ -344,12 +353,14 @@ def maybe_skip_member(app, what, name, obj, skip, options):
return False
whitelisted_init_classes = ["GogsApi", "Token", "UsernamePassword", "Builder"]
if name == "__init__":
return obj.im_class.__name__ not in whitelisted_init_classes
if hasattr(obj, 'im_class'):
return obj.im_class.__name__ not in whitelisted_init_classes
blacklisted_names = ["update_kwargs"]
return skip or (name in blacklisted_names)

def setup(app):
app.connect('autodoc-skip-member', maybe_skip_member)
app.connect('autodoc-process-signature', process_signature)

def add_directive_header(self, sig):
ModuleLevelDocumenter.add_directive_header(self, sig)
Expand Down
6 changes: 6 additions & 0 deletions docs/entities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ GogsTeam

.. autoclass:: gogs_client.entities::GogsTeam()
:members:

GogsEntity
----------

.. autoclass:: gogs_client.entities::GogsEntity()
:members:
Loading