mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Give "nonl=True" value to logging.info() instead of int
This commit is contained in:
parent
c5f20a9046
commit
332f98d44c
@ -339,7 +339,7 @@ class Builder:
|
|||||||
updated_docnames = set(self.read())
|
updated_docnames = set(self.read())
|
||||||
|
|
||||||
doccount = len(updated_docnames)
|
doccount = len(updated_docnames)
|
||||||
logger.info(bold(__('looking for now-outdated files... ')), nonl=1)
|
logger.info(bold(__('looking for now-outdated files... ')), nonl=True)
|
||||||
for docname in self.env.check_dependents(self.app, updated_docnames):
|
for docname in self.env.check_dependents(self.app, updated_docnames):
|
||||||
updated_docnames.add(docname)
|
updated_docnames.add(docname)
|
||||||
outdated = len(updated_docnames) - doccount
|
outdated = len(updated_docnames) - doccount
|
||||||
|
@ -236,7 +236,7 @@ class MessageCatalogBuilder(I18nBuilder):
|
|||||||
# type: () -> None
|
# type: () -> None
|
||||||
files = list(self._collect_templates())
|
files = list(self._collect_templates())
|
||||||
files.sort()
|
files.sort()
|
||||||
logger.info(bold(__('building [%s]: ') % self.name), nonl=1)
|
logger.info(bold(__('building [%s]: ') % self.name), nonl=True)
|
||||||
logger.info(__('targets for %d template files'), len(files))
|
logger.info(__('targets for %d template files'), len(files))
|
||||||
|
|
||||||
extract_translations = self.templates.environment.extract_translations
|
extract_translations = self.templates.environment.extract_translations
|
||||||
|
@ -692,7 +692,7 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
|
|
||||||
def gen_indices(self):
|
def gen_indices(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
logger.info(bold(__('generating indices...')), nonl=1)
|
logger.info(bold(__('generating indices...')), nonl=True)
|
||||||
|
|
||||||
# the global general index
|
# the global general index
|
||||||
if self.use_index:
|
if self.use_index:
|
||||||
@ -710,21 +710,21 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
for pagename, context, template in pagelist:
|
for pagename, context, template in pagelist:
|
||||||
self.handle_page(pagename, context, template)
|
self.handle_page(pagename, context, template)
|
||||||
|
|
||||||
logger.info(bold(__('writing additional pages...')), nonl=1)
|
logger.info(bold(__('writing additional pages...')), nonl=True)
|
||||||
|
|
||||||
# additional pages from conf.py
|
# additional pages from conf.py
|
||||||
for pagename, template in self.config.html_additional_pages.items():
|
for pagename, template in self.config.html_additional_pages.items():
|
||||||
logger.info(' ' + pagename, nonl=1)
|
logger.info(' ' + pagename, nonl=True)
|
||||||
self.handle_page(pagename, {}, template)
|
self.handle_page(pagename, {}, template)
|
||||||
|
|
||||||
# the search page
|
# the search page
|
||||||
if self.search:
|
if self.search:
|
||||||
logger.info(' search', nonl=1)
|
logger.info(' search', nonl=True)
|
||||||
self.handle_page('search', {}, 'search.html')
|
self.handle_page('search', {}, 'search.html')
|
||||||
|
|
||||||
# the opensearch xml file
|
# the opensearch xml file
|
||||||
if self.config.html_use_opensearch and self.search:
|
if self.config.html_use_opensearch and self.search:
|
||||||
logger.info(' opensearch', nonl=1)
|
logger.info(' opensearch', nonl=True)
|
||||||
fn = path.join(self.outdir, '_static', 'opensearch.xml')
|
fn = path.join(self.outdir, '_static', 'opensearch.xml')
|
||||||
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
|
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
|
||||||
|
|
||||||
@ -745,7 +745,7 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
'genindexcounts': indexcounts,
|
'genindexcounts': indexcounts,
|
||||||
'split_index': self.config.html_split_index,
|
'split_index': self.config.html_split_index,
|
||||||
}
|
}
|
||||||
logger.info(' genindex', nonl=1)
|
logger.info(' genindex', nonl=True)
|
||||||
|
|
||||||
if self.config.html_split_index:
|
if self.config.html_split_index:
|
||||||
self.handle_page('genindex', genindexcontext,
|
self.handle_page('genindex', genindexcontext,
|
||||||
@ -768,7 +768,7 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
'content': content,
|
'content': content,
|
||||||
'collapse_index': collapse,
|
'collapse_index': collapse,
|
||||||
}
|
}
|
||||||
logger.info(' ' + indexname, nonl=1)
|
logger.info(' ' + indexname, nonl=True)
|
||||||
self.handle_page(indexname, indexcontext, 'domainindex.html')
|
self.handle_page(indexname, indexcontext, 'domainindex.html')
|
||||||
|
|
||||||
def copy_image_files(self):
|
def copy_image_files(self):
|
||||||
|
@ -250,7 +250,7 @@ class LaTeXBuilder(Builder):
|
|||||||
toctree_only = entry[5]
|
toctree_only = entry[5]
|
||||||
destination = SphinxFileOutput(destination_path=path.join(self.outdir, targetname),
|
destination = SphinxFileOutput(destination_path=path.join(self.outdir, targetname),
|
||||||
encoding='utf-8', overwrite_if_changed=True)
|
encoding='utf-8', overwrite_if_changed=True)
|
||||||
logger.info(__("processing %s..."), targetname, nonl=1)
|
logger.info(__("processing %s..."), targetname, nonl=True)
|
||||||
toctrees = self.env.get_doctree(docname).traverse(addnodes.toctree)
|
toctrees = self.env.get_doctree(docname).traverse(addnodes.toctree)
|
||||||
if toctrees:
|
if toctrees:
|
||||||
if toctrees[0].get('maxdepth') > 0:
|
if toctrees[0].get('maxdepth') > 0:
|
||||||
@ -267,7 +267,7 @@ class LaTeXBuilder(Builder):
|
|||||||
self.post_process_images(doctree)
|
self.post_process_images(doctree)
|
||||||
self.update_doc_context(title, author)
|
self.update_doc_context(title, author)
|
||||||
|
|
||||||
logger.info(__("writing... "), nonl=1)
|
logger.info(__("writing... "), nonl=True)
|
||||||
docsettings.author = author
|
docsettings.author = author
|
||||||
docsettings.title = title
|
docsettings.title = title
|
||||||
docsettings.contentsname = self.get_contentsname(docname)
|
docsettings.contentsname = self.get_contentsname(docname)
|
||||||
@ -298,7 +298,7 @@ class LaTeXBuilder(Builder):
|
|||||||
# type: (str, bool, List[str]) -> nodes.document
|
# type: (str, bool, List[str]) -> nodes.document
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
self.docnames = set([indexfile] + appendices)
|
self.docnames = set([indexfile] + appendices)
|
||||||
logger.info(darkgreen(indexfile) + " ", nonl=1)
|
logger.info(darkgreen(indexfile) + " ", nonl=True)
|
||||||
tree = self.env.get_doctree(indexfile)
|
tree = self.env.get_doctree(indexfile)
|
||||||
tree['docname'] = indexfile
|
tree['docname'] = indexfile
|
||||||
if toctree_only:
|
if toctree_only:
|
||||||
@ -388,9 +388,9 @@ class LaTeXBuilder(Builder):
|
|||||||
|
|
||||||
# copy additional files
|
# copy additional files
|
||||||
if self.config.latex_additional_files:
|
if self.config.latex_additional_files:
|
||||||
logger.info(bold(__('copying additional files...')), nonl=1)
|
logger.info(bold(__('copying additional files...')), nonl=True)
|
||||||
for filename in self.config.latex_additional_files:
|
for filename in self.config.latex_additional_files:
|
||||||
logger.info(' ' + filename, nonl=1)
|
logger.info(' ' + filename, nonl=True)
|
||||||
copy_asset_file(path.join(self.confdir, filename), self.outdir)
|
copy_asset_file(path.join(self.confdir, filename), self.outdir)
|
||||||
logger.info('')
|
logger.info('')
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ class CheckExternalLinksBuilder(Builder):
|
|||||||
if status == 'working' and info == 'old':
|
if status == 'working' and info == 'old':
|
||||||
return
|
return
|
||||||
if lineno:
|
if lineno:
|
||||||
logger.info('(line %4d) ', lineno, nonl=1)
|
logger.info('(line %4d) ', lineno, nonl=True)
|
||||||
if status == 'ignored':
|
if status == 'ignored':
|
||||||
if info:
|
if info:
|
||||||
logger.info(darkgray('-ignored- ') + uri + ': ' + info)
|
logger.info(darkgray('-ignored- ') + uri + ': ' + info)
|
||||||
|
@ -179,15 +179,15 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
|
|||||||
def finish(self):
|
def finish(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
# no indices or search pages are supported
|
# no indices or search pages are supported
|
||||||
logger.info(bold(__('writing additional files...')), nonl=1)
|
logger.info(bold(__('writing additional files...')), nonl=True)
|
||||||
|
|
||||||
# additional pages from conf.py
|
# additional pages from conf.py
|
||||||
for pagename, template in self.config.html_additional_pages.items():
|
for pagename, template in self.config.html_additional_pages.items():
|
||||||
logger.info(' ' + pagename, nonl=1)
|
logger.info(' ' + pagename, nonl=True)
|
||||||
self.handle_page(pagename, {}, template)
|
self.handle_page(pagename, {}, template)
|
||||||
|
|
||||||
if self.config.html_use_opensearch:
|
if self.config.html_use_opensearch:
|
||||||
logger.info(' opensearch', nonl=1)
|
logger.info(' opensearch', nonl=True)
|
||||||
fn = path.join(self.outdir, '_static', 'opensearch.xml')
|
fn = path.join(self.outdir, '_static', 'opensearch.xml')
|
||||||
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
|
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
|
||||||
|
|
||||||
|
@ -113,11 +113,11 @@ class TexinfoBuilder(Builder):
|
|||||||
destination = FileOutput(
|
destination = FileOutput(
|
||||||
destination_path=path.join(self.outdir, targetname),
|
destination_path=path.join(self.outdir, targetname),
|
||||||
encoding='utf-8')
|
encoding='utf-8')
|
||||||
logger.info(__("processing %s..."), targetname, nonl=1)
|
logger.info(__("processing %s..."), targetname, nonl=True)
|
||||||
doctree = self.assemble_doctree(
|
doctree = self.assemble_doctree(
|
||||||
docname, toctree_only,
|
docname, toctree_only,
|
||||||
appendices=(self.config.texinfo_appendices or []))
|
appendices=(self.config.texinfo_appendices or []))
|
||||||
logger.info(__("writing... "), nonl=1)
|
logger.info(__("writing... "), nonl=True)
|
||||||
self.post_process_images(doctree)
|
self.post_process_images(doctree)
|
||||||
docwriter = TexinfoWriter(self)
|
docwriter = TexinfoWriter(self)
|
||||||
settings = OptionParser(
|
settings = OptionParser(
|
||||||
@ -139,7 +139,7 @@ class TexinfoBuilder(Builder):
|
|||||||
def assemble_doctree(self, indexfile, toctree_only, appendices):
|
def assemble_doctree(self, indexfile, toctree_only, appendices):
|
||||||
# type: (str, bool, List[str]) -> nodes.document
|
# type: (str, bool, List[str]) -> nodes.document
|
||||||
self.docnames = set([indexfile] + appendices)
|
self.docnames = set([indexfile] + appendices)
|
||||||
logger.info(darkgreen(indexfile) + " ", nonl=1)
|
logger.info(darkgreen(indexfile) + " ", nonl=True)
|
||||||
tree = self.env.get_doctree(indexfile)
|
tree = self.env.get_doctree(indexfile)
|
||||||
tree['docname'] = indexfile
|
tree['docname'] = indexfile
|
||||||
if toctree_only:
|
if toctree_only:
|
||||||
@ -186,7 +186,7 @@ class TexinfoBuilder(Builder):
|
|||||||
logger.info(bold(__('copying Texinfo support files... ')), nonl=True)
|
logger.info(bold(__('copying Texinfo support files... ')), nonl=True)
|
||||||
# copy Makefile
|
# copy Makefile
|
||||||
fn = path.join(self.outdir, 'Makefile')
|
fn = path.join(self.outdir, 'Makefile')
|
||||||
logger.info(fn, nonl=1)
|
logger.info(fn, nonl=True)
|
||||||
try:
|
try:
|
||||||
copy_asset_file(os.path.join(template_dir, 'Makefile'), fn)
|
copy_asset_file(os.path.join(template_dir, 'Makefile'), fn)
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
|
@ -153,9 +153,6 @@ def collect_pages(app):
|
|||||||
|
|
||||||
modnames = set(env._viewcode_modules) # type: ignore
|
modnames = set(env._viewcode_modules) # type: ignore
|
||||||
|
|
||||||
# app.builder.info(' (%d module code pages)' %
|
|
||||||
# len(env._viewcode_modules), nonl=1)
|
|
||||||
|
|
||||||
for modname, entry in status_iterator(
|
for modname, entry in status_iterator(
|
||||||
sorted(env._viewcode_modules.items()), # type: ignore
|
sorted(env._viewcode_modules.items()), # type: ignore
|
||||||
__('highlighting module code... '), "blue",
|
__('highlighting module code... '), "blue",
|
||||||
|
@ -402,7 +402,7 @@ def inline_all_toctrees(builder, docnameset, docname, tree, colorfunc, traversed
|
|||||||
if includefile not in traversed:
|
if includefile not in traversed:
|
||||||
try:
|
try:
|
||||||
traversed.append(includefile)
|
traversed.append(includefile)
|
||||||
logger.info(colorfunc(includefile) + " ", nonl=1)
|
logger.info(colorfunc(includefile) + " ", nonl=True)
|
||||||
subtree = inline_all_toctrees(builder, docnameset, includefile,
|
subtree = inline_all_toctrees(builder, docnameset, includefile,
|
||||||
builder.env.get_doctree(includefile),
|
builder.env.get_doctree(includefile),
|
||||||
colorfunc, traversed)
|
colorfunc, traversed)
|
||||||
|
Loading…
Reference in New Issue
Block a user