@@ -487,7 +487,7 @@ def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst',
487487 from jinja2 .sandbox import SandboxedEnvironment
488488
489489 from .utils import find_autosummary_in_lines_for_automodsumm as find_autosummary_in_lines
490- from .utils import get_documenter
490+ from .utils import get_object_type
491491
492492 # Create our own templating environment - here we use Astropy's
493493 # templates rather than the default autosummary templates, in order to
@@ -555,14 +555,14 @@ def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst',
555555
556556 with open (fn , 'w' , encoding = 'utf8' ) as f :
557557
558- doc = get_documenter (app , obj , parent )
558+ obj_type = get_object_type (app , obj , parent )
559559
560560 if template_name is not None :
561561 template = template_env .get_template (template_name )
562562 else :
563563 tmplstr = 'autosummary_core/%s.rst'
564564 try :
565- template = template_env .get_template (tmplstr % doc . objtype )
565+ template = template_env .get_template (tmplstr % obj_type )
566566 except TemplateNotFound :
567567 template = template_env .get_template (tmplstr % 'base' )
568568
@@ -573,10 +573,10 @@ def get_members_mod(obj, typ, include_public=[]):
573573 items = []
574574 for name in dir (obj ):
575575 try :
576- documenter = get_documenter (app , safe_getattr (obj , name ), obj )
576+ obj_type = get_object_type (app , safe_getattr (obj , name ), obj )
577577 except AttributeError :
578578 continue
579- if typ is None or documenter . objtype == typ :
579+ if typ is None or obj_type == typ :
580580 items .append (name )
581581 public = [x for x in items
582582 if x in include_public or not x .startswith ('_' )]
@@ -604,36 +604,36 @@ def get_members_class(obj, typ, include_public=[],
604604
605605 for name in names :
606606 try :
607- documenter = get_documenter (app , safe_getattr (obj , name ), obj )
607+ obj_type = get_object_type (app , safe_getattr (obj , name ), obj )
608608 except AttributeError :
609609 # for dataclasses try to get the attribute from the __dataclass_fields__
610610 if dataclasses .is_dataclass (obj ):
611611 try :
612612 attr = obj .__dataclass_fields__ [name ]
613- documenter = get_documenter (app , attr , obj )
613+ obj_type = get_object_type (app , attr , obj )
614614 except KeyError :
615615 continue
616- if typ is None or documenter . objtype == typ :
616+ if typ is None or obj_type == typ :
617617 items .append (name )
618- # elif typ == 'attribute' and documenter.objtype == 'property':
618+ # elif typ == 'attribute' and obj_type == 'property':
619619 # # In Sphinx 2.0 and above, properties have a separate
620- # # objtype , but we treat them the same here.
620+ # # object type , but we treat them the same here.
621621 # items.append(name)
622622 public = [x for x in items
623623 if x in include_public or not x .startswith ('_' )]
624624 return public , items
625625
626626 ns = {}
627627
628- if doc . objtype == 'module' :
628+ if obj_type == 'module' :
629629 ns ['members' ] = get_members_mod (obj , None )
630630 ns ['functions' ], ns ['all_functions' ] = \
631631 get_members_mod (obj , 'function' )
632632 ns ['classes' ], ns ['all_classes' ] = \
633633 get_members_mod (obj , 'class' )
634634 ns ['exceptions' ], ns ['all_exceptions' ] = \
635635 get_members_mod (obj , 'exception' )
636- elif doc . objtype == 'class' :
636+ elif obj_type == 'class' :
637637 if inherited_mem is not None :
638638 # option set in this specifc directive
639639 include_base = inherited_mem
@@ -662,7 +662,7 @@ def get_members_class(obj, typ, include_public=[],
662662 ns ['attributes' ].sort ()
663663
664664 parts = name .split ('.' )
665- if doc . objtype in ('method' , 'attribute' ):
665+ if obj_type in ('method' , 'attribute' ):
666666 mod_name = '.' .join (parts [:- 2 ])
667667 cls_name = parts [- 2 ]
668668 obj_name = '.' .join (parts [- 2 :])
@@ -676,7 +676,7 @@ def get_members_class(obj, typ, include_public=[],
676676 ns ['objname' ] = obj_name
677677 ns ['name' ] = parts [- 1 ]
678678
679- ns ['objtype' ] = doc . objtype
679+ ns ['objtype' ] = obj_type
680680 ns ['underline' ] = len (obj_name ) * '='
681681
682682 # We now check whether a file for reference footnotes exists for
0 commit comments