1111from sphinx .util .osutil import ensuredir
1212import sphinx .util .logging
1313
14+ try :
15+ from sphinx .util .display import status_iterator
16+ except ImportError :
17+ # This method was moved into sphinx.util.display in Sphinx 6.1.0. Before
18+ # that it resided in sphinx.util.
19+ from sphinx .util import status_iterator
20+
1421from ..settings import API_ROOT , TEMPLATE_DIR
1522
1623LOGGER = sphinx .util .logging .getLogger (__name__ )
@@ -207,7 +214,7 @@ def _wrapped_prepare(value):
207214 def load (self , patterns , dirs , ignore = None ):
208215 """Load objects from the filesystem into the ``paths`` dictionary."""
209216 paths = list (self .find_files (patterns = patterns , dirs = dirs , ignore = ignore ))
210- for path in sphinx . util . display . status_iterator (
217+ for path in status_iterator (
211218 paths ,
212219 colorize ("bold" , "[AutoAPI] Reading files... " ),
213220 "darkgreen" ,
@@ -290,7 +297,7 @@ def add_object(self, obj):
290297
291298 def map (self , options = None ):
292299 """Trigger find of serialized sources and build objects"""
293- for _ , data in sphinx . util . display . status_iterator (
300+ for _ , data in status_iterator (
294301 self .paths .items (),
295302 colorize ("bold" , "[AutoAPI] " ) + "Mapping Data... " ,
296303 length = len (self .paths ),
@@ -308,7 +315,7 @@ def create_class(self, data, options=None, **kwargs):
308315 raise NotImplementedError
309316
310317 def output_rst (self , root , source_suffix ):
311- for _ , obj in sphinx . util . display . status_iterator (
318+ for _ , obj in status_iterator (
312319 self .objects .items (),
313320 colorize ("bold" , "[AutoAPI] " ) + "Rendering Data... " ,
314321 length = len (self .objects ),
0 commit comments