mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
manpage: refactor with progress_message()
This commit is contained in:
parent
f82a266814
commit
81208ad704
@ -18,7 +18,8 @@ from sphinx.builders import Builder
|
|||||||
from sphinx.environment import NoUri
|
from sphinx.environment import NoUri
|
||||||
from sphinx.locale import __
|
from sphinx.locale import __
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
from sphinx.util.console import bold, darkgreen # type: ignore
|
from sphinx.util import progress_message
|
||||||
|
from sphinx.util.console import darkgreen # type: ignore
|
||||||
from sphinx.util.nodes import inline_all_toctrees
|
from sphinx.util.nodes import inline_all_toctrees
|
||||||
from sphinx.util.osutil import make_filename_from_project
|
from sphinx.util.osutil import make_filename_from_project
|
||||||
from sphinx.writers.manpage import ManualPageWriter, ManualPageTranslator
|
from sphinx.writers.manpage import ManualPageWriter, ManualPageTranslator
|
||||||
@ -60,6 +61,7 @@ class ManualPageBuilder(Builder):
|
|||||||
return ''
|
return ''
|
||||||
raise NoUri
|
raise NoUri
|
||||||
|
|
||||||
|
@progress_message(__('writing'))
|
||||||
def write(self, *ignored):
|
def write(self, *ignored):
|
||||||
# type: (Any) -> None
|
# type: (Any) -> None
|
||||||
docwriter = ManualPageWriter(self)
|
docwriter = ManualPageWriter(self)
|
||||||
@ -68,8 +70,6 @@ class ManualPageBuilder(Builder):
|
|||||||
components=(docwriter,),
|
components=(docwriter,),
|
||||||
read_config_files=True).get_default_values() # type: Any
|
read_config_files=True).get_default_values() # type: Any
|
||||||
|
|
||||||
logger.info(bold(__('writing... ')), nonl=True)
|
|
||||||
|
|
||||||
for info in self.config.man_pages:
|
for info in self.config.man_pages:
|
||||||
docname, name, description, authors, section = info
|
docname, name, description, authors, section = info
|
||||||
if docname not in self.env.all_docs:
|
if docname not in self.env.all_docs:
|
||||||
@ -105,7 +105,6 @@ class ManualPageBuilder(Builder):
|
|||||||
pendingnode.replace_self(pendingnode.children)
|
pendingnode.replace_self(pendingnode.children)
|
||||||
|
|
||||||
docwriter.write(largetree, destination)
|
docwriter.write(largetree, destination)
|
||||||
logger.info('')
|
|
||||||
|
|
||||||
def finish(self):
|
def finish(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
|
Loading…
Reference in New Issue
Block a user