Skip to content
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

Merged
merged 1 commit into from Oct 4, 2020

Conversation

shimizukawa
Copy link
Member

Feature or Bugfix

  • Bugfix

Purpose

Fixing console output on building

  1. Missing spacing before done
  2. Redundant spacing after ...
  3. Redundant ... after ...

Detail

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

Relates

This tiny trouble has been introduced at #6538 (sphinx-2.0.0 Mar 29, 2019)

…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)
Copy link
Member Author

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.

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)
Copy link
Member Author

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)
Copy link
Member Author

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)
Copy link
Member Author

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)
Copy link
Member Author

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')):
Copy link
Member Author

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 ... .

@tk0miya tk0miya merged commit 3d92c02 into sphinx-doc:3.x Oct 4, 2020
tk0miya added a commit that referenced this pull request Oct 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants