New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: missing and redundant spacing (and etc) for console output on building #8277
Conversation
…ilding. Before this fixing: ``` generating indices... genindexdone writing additional pages... searchdone copying static files... ... done ``` After this fixing: ``` generating indices... genindex done writing additional pages... search done copying static files... done ``` This tiny trouble has been introduced at sphinx-doc#6538 (sphinx-2.0.0 Mar 29, 2019)
@@ -641,17 +641,17 @@ def gen_pages_from_extensions(self) -> None: | |||
def gen_additional_pages(self) -> None: | |||
# additional pages from conf.py | |||
for pagename, template in self.config.html_additional_pages.items(): | |||
logger.info(' ' + pagename, nonl=True) | |||
logger.info(pagename + ' ', nonl=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@progress_message
decorator uses "after spacing" model, so logger output inside the decorator should use same model.
sphinx/sphinx/util/__init__.py
Lines 691 to 707 in ae7c4cc
class progress_message: | |
def __init__(self, message: str) -> None: | |
self.message = message | |
def __enter__(self) -> None: | |
logger.info(bold(self.message + '... '), nonl=True) | |
def __exit__(self, exc_type: "Type[Exception]", exc_value: Exception, traceback: Any) -> bool: # NOQA | |
if isinstance(exc_value, SkipProgressMessage): | |
logger.info(__('skipped')) | |
if exc_value.args: | |
logger.info(*exc_value.args) | |
return True | |
elif exc_type: | |
logger.info(__('failed')) | |
else: | |
logger.info(__('done')) |
self.handle_page(pagename, {}, template) | ||
|
||
# the search page | ||
if self.search: | ||
logger.info(' search', nonl=True) | ||
logger.info('search ', nonl=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"after spacing"
self.handle_page('search', {}, 'search.html') | ||
|
||
# the opensearch xml file | ||
if self.config.html_use_opensearch and self.search: | ||
logger.info(' opensearch', nonl=True) | ||
logger.info('opensearch ', nonl=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"after spacing"
@@ -669,7 +669,7 @@ def write_genindex(self) -> None: | |||
'genindexcounts': indexcounts, | |||
'split_index': self.config.html_split_index, | |||
} | |||
logger.info(' genindex', nonl=True) | |||
logger.info('genindex ', nonl=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"after spacing"
@@ -691,7 +691,7 @@ def write_domain_indices(self) -> None: | |||
'content': content, | |||
'collapse_index': collapse, | |||
} | |||
logger.info(' ' + indexname, nonl=True) | |||
logger.info(indexname + ' ', nonl=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"after spacing"
@@ -785,7 +785,7 @@ def copy_html_favicon(self) -> None: | |||
|
|||
def copy_static_files(self) -> None: | |||
try: | |||
with progress_message(__('copying static files... ')): | |||
with progress_message(__('copying static files')): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing redundant ...
.
Already progress_message
with context automatically emits ...
.
Feature or Bugfix
Purpose
Fixing console output on building
done
...
...
after...
Detail
Before this fixing:
After this fixing:
Relates
This tiny trouble has been introduced at #6538 (sphinx-2.0.0 Mar 29, 2019)