mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
builders: fix status_iterator backwards compatibility
This commit is contained in:
parent
b0381f97f8
commit
71360bcac6
@ -107,7 +107,7 @@ class Builder(object):
|
||||
raise NotImplementedError
|
||||
|
||||
def old_status_iterator(self, iterable, summary, colorfunc=darkgreen,
|
||||
stringify_func=str):
|
||||
stringify_func=lambda x: x):
|
||||
l = 0
|
||||
for item in iterable:
|
||||
if l == 0:
|
||||
@ -120,9 +120,10 @@ class Builder(object):
|
||||
|
||||
# new version with progress info
|
||||
def status_iterator(self, iterable, summary, colorfunc=darkgreen, length=0,
|
||||
stringify_func=str):
|
||||
stringify_func=lambda x: x):
|
||||
if length == 0:
|
||||
for item in self.old_status_iterator(iterable, summary, colorfunc):
|
||||
for item in self.old_status_iterator(iterable, summary, colorfunc,
|
||||
stringify_func):
|
||||
yield item
|
||||
return
|
||||
l = 0
|
||||
|
@ -161,9 +161,8 @@ class MessageCatalogBuilder(I18nBuilder):
|
||||
)
|
||||
for textdomain, catalog in self.status_iterator(
|
||||
self.catalogs.iteritems(), "writing message catalogs... ",
|
||||
lambda (textdomain, _): darkgreen(textdomain),
|
||||
len(self.catalogs)):
|
||||
|
||||
darkgreen, len(self.catalogs),
|
||||
lambda (textdomain, _): textdomain):
|
||||
# noop if config.gettext_compact is set
|
||||
ensuredir(path.join(self.outdir, path.dirname(textdomain)))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user