mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Migrate to py3 style type annotation: sphinx.builders.dummy
This commit is contained in:
parent
7f2e9cebf9
commit
4488815dca
@ -8,16 +8,14 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, Set
|
||||
|
||||
from docutils.nodes import Node
|
||||
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.locale import __
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
||||
class DummyBuilder(Builder):
|
||||
name = 'dummy'
|
||||
@ -25,33 +23,26 @@ class DummyBuilder(Builder):
|
||||
|
||||
allow_parallel = True
|
||||
|
||||
def init(self):
|
||||
# type: () -> None
|
||||
def init(self) -> None:
|
||||
pass
|
||||
|
||||
def get_outdated_docs(self):
|
||||
# type: () -> Set[str]
|
||||
def get_outdated_docs(self) -> Set[str]:
|
||||
return self.env.found_docs
|
||||
|
||||
def get_target_uri(self, docname, typ=None):
|
||||
# type: (str, str) -> str
|
||||
def get_target_uri(self, docname: str, typ: str = None) -> str:
|
||||
return ''
|
||||
|
||||
def prepare_writing(self, docnames):
|
||||
# type: (Set[str]) -> None
|
||||
def prepare_writing(self, docnames: Set[str]) -> None:
|
||||
pass
|
||||
|
||||
def write_doc(self, docname, doctree):
|
||||
# type: (str, nodes.Node) -> None
|
||||
def write_doc(self, docname: str, doctree: Node) -> None:
|
||||
pass
|
||||
|
||||
def finish(self):
|
||||
# type: () -> None
|
||||
def finish(self) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def setup(app):
|
||||
# type: (Sphinx) -> Dict[str, Any]
|
||||
def setup(app: Sphinx) -> Dict[str, Any]:
|
||||
app.add_builder(DummyBuilder)
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user