Georg Brandl avatar Georg Brandl committed 500930c

Use status iterator for images and dlfiles.

Comments (0)

Files changed (1)

sphinx/builders/html.py

 from sphinx.builders import Builder
 from sphinx.application import ENV_PICKLE_FILENAME
 from sphinx.highlighting import PygmentsBridge
-from sphinx.util.console import bold, darkgreen
+from sphinx.util.console import bold, darkgreen, brown
 from sphinx.writers.html import HTMLWriter, HTMLTranslator, \
      SmartyPantsHTMLTranslator
 
     def copy_image_files(self):
         # copy image files
         if self.images:
-            self.info(bold('copying images...'), nonl=True)
             ensuredir(path.join(self.outdir, '_images'))
-            for src, dest in self.images.iteritems():
-                self.info(' '+src, nonl=1)
+            for src in self.status_iterator(self.images, 'copying images... ',
+                                            brown, len(self.images)):
+                dest = self.images[src]
                 try:
                     copyfile(path.join(self.srcdir, src),
                              path.join(self.outdir, '_images', dest))
                 except Exception, err:
                     self.warn('cannot copy image file %r: %s' %
                               (path.join(self.srcdir, src), err))
-            self.info()
 
     def copy_download_files(self):
         # copy downloadable files
         if self.env.dlfiles:
-            self.info(bold('copying downloadable files...'), nonl=True)
             ensuredir(path.join(self.outdir, '_downloads'))
-            for src, (_, dest) in self.env.dlfiles.iteritems():
-                self.info(' '+src, nonl=1)
+            for src in self.status_iterator(self.env.dlfiles,
+                                            'copying downloadable files... ',
+                                            brown, len(self.env.dlfiles)):
+                dest = self.env.dlfiles[src][1]
                 try:
                     copyfile(path.join(self.srcdir, src),
                              path.join(self.outdir, '_downloads', dest))
                 except Exception, err:
                     self.warn('cannot copy downloadable file %r: %s' %
                               (path.join(self.srcdir, src), err))
-            self.info()
 
     def copy_static_files(self):
         # copy static files
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.