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
|
raise NotImplementedError
|
||||||
|
|
||||||
def old_status_iterator(self, iterable, summary, colorfunc=darkgreen,
|
def old_status_iterator(self, iterable, summary, colorfunc=darkgreen,
|
||||||
stringify_func=str):
|
stringify_func=lambda x: x):
|
||||||
l = 0
|
l = 0
|
||||||
for item in iterable:
|
for item in iterable:
|
||||||
if l == 0:
|
if l == 0:
|
||||||
@ -120,9 +120,10 @@ class Builder(object):
|
|||||||
|
|
||||||
# new version with progress info
|
# new version with progress info
|
||||||
def status_iterator(self, iterable, summary, colorfunc=darkgreen, length=0,
|
def status_iterator(self, iterable, summary, colorfunc=darkgreen, length=0,
|
||||||
stringify_func=str):
|
stringify_func=lambda x: x):
|
||||||
if length == 0:
|
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
|
yield item
|
||||||
return
|
return
|
||||||
l = 0
|
l = 0
|
||||||
|
@ -161,9 +161,8 @@ class MessageCatalogBuilder(I18nBuilder):
|
|||||||
)
|
)
|
||||||
for textdomain, catalog in self.status_iterator(
|
for textdomain, catalog in self.status_iterator(
|
||||||
self.catalogs.iteritems(), "writing message catalogs... ",
|
self.catalogs.iteritems(), "writing message catalogs... ",
|
||||||
lambda (textdomain, _): darkgreen(textdomain),
|
darkgreen, len(self.catalogs),
|
||||||
len(self.catalogs)):
|
lambda (textdomain, _): textdomain):
|
||||||
|
|
||||||
# noop if config.gettext_compact is set
|
# noop if config.gettext_compact is set
|
||||||
ensuredir(path.join(self.outdir, path.dirname(textdomain)))
|
ensuredir(path.join(self.outdir, path.dirname(textdomain)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user