diff --git a/docs/templates/pdocs/class.mako b/docs/templates/pdocs/class.mako index fddd60f2..9022acb6 100644 --- a/docs/templates/pdocs/class.mako +++ b/docs/templates/pdocs/class.mako @@ -68,19 +68,20 @@ ${cls.docstring} mro = cls.mro() subclasses = cls.subclasses() %> -% if mro: -${h4('Ancestors (in MRO)')} - % for c in mro: -* ${c.refname} - % endfor -% endif -% if subclasses: -${h4('Descendants')} - % for c in subclasses: -* ${c.refname} - % endfor -% endif +## % if mro: +## ${h4('Ancestors (in MRO)')} +## % for c in mro: +## * ${c.refname} +## % endfor +## % endif + +## % if subclasses: +## ${h4('Descendants')} +## % for c in subclasses: +## * ${c.refname} +## % endfor +## % endif % if class_vars_internal: ${h4('Class variables')} diff --git a/src/omnipy/util/mako_helpers.py b/src/omnipy/util/mako_helpers.py index a370c5ab..ad724e82 100644 --- a/src/omnipy/util/mako_helpers.py +++ b/src/omnipy/util/mako_helpers.py @@ -18,17 +18,21 @@ def filter_external(members: List[Doc]): def filter_internal(members: List[Doc]): - return list(_ for _ in members if not externally_inherited(_)) + ret = {_.name: externally_inherited(_) for _ in members} + + ret = list(_ for _ in members if not externally_inherited(_)) + return ret def externally_inherited(member: Doc): - if hasattr(member, 'inherits'): - if externally_inherited(member.inherits): - return True - elif not member.inherits.cls.module.name.startswith('omnipy'): - print(member.inherits.cls.module.name) - return True - return member.name not in vars(member.cls.cls) + inherited = member.name not in vars(member.cls.cls) + if hasattr(member.cls.cls, member.name): + member_obj = getattr(member.cls.cls, member.name) + internal = hasattr(member_obj, '__module__') and member_obj.__module__.startswith('omnipy') + else: + internal = False + + return inherited and not internal def merge_signature_with_docstring(func: Function,