diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-02-08 14:31:59 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-02-08 18:38:42 +0900 |
commit | 6fa0262802a09050e09445c9fd630c69b5ad1204 (patch) | |
tree | a2ad8f7849540d1b027e0b99d9913394b23c58d8 /sphinx/directives/patches.py | |
parent | 81eb101e9f8fcee1c439ee0dd501d135eced01c6 (diff) | |
download | sphinx-git-6fa0262802a09050e09445c9fd630c69b5ad1204.tar.gz |
Fix mypy violations
Diffstat (limited to 'sphinx/directives/patches.py')
-rw-r--r-- | sphinx/directives/patches.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sphinx/directives/patches.py b/sphinx/directives/patches.py index 8b14ba2b0..2501df417 100644 --- a/sphinx/directives/patches.py +++ b/sphinx/directives/patches.py @@ -13,6 +13,10 @@ from docutils.parsers.rst.directives import images, html from sphinx import addnodes +if False: + # For type annotation + from sphinx.application import Sphinx # NOQA + class Figure(images.Figure): """The figure directive which applies `:name:` option to the figure node @@ -20,6 +24,7 @@ class Figure(images.Figure): """ def run(self): + # type: () -> List[nodes.Node] name = self.options.pop('name', None) result = images.Figure.run(self) if len(result) == 2 or isinstance(result[0], nodes.system_message): @@ -39,6 +44,7 @@ class Figure(images.Figure): class Meta(html.Meta): def run(self): + # type: () -> List[nodes.Node] env = self.state.document.settings.env result = html.Meta.run(self) for node in result: @@ -56,6 +62,7 @@ class Meta(html.Meta): def setup(app): + # type: (Sphinx) -> Dict directives.register_directive('figure', Figure) directives.register_directive('meta', Meta) |