diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-30 15:10:32 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-07-01 01:02:04 +0900 |
commit | 4ba85181177e732b032486324cc64a0f3bc1ac3d (patch) | |
tree | fa7bd2cb480e4a62558f22480cbc52c4ef64906f /sphinx/ext/githubpages.py | |
parent | d57e338510d10e3685324f3029b15ab41a3817c0 (diff) | |
download | sphinx-git-4ba85181177e732b032486324cc64a0f3bc1ac3d.tar.gz |
Migrate to py3 style type annotation: sphinx.ext.githubpages
Diffstat (limited to 'sphinx/ext/githubpages.py')
-rw-r--r-- | sphinx/ext/githubpages.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sphinx/ext/githubpages.py b/sphinx/ext/githubpages.py index 5cecddd09..6a07c651a 100644 --- a/sphinx/ext/githubpages.py +++ b/sphinx/ext/githubpages.py @@ -10,18 +10,14 @@ import os import urllib +from typing import Any, Dict import sphinx +from sphinx.application import Sphinx +from sphinx.environment import BuildEnvironment -if False: - # For type annotation - from typing import Any, Dict # NOQA - from sphinx.application import Sphinx # NOQA - from sphinx.environment import BuildEnvironment # NOQA - -def create_nojekyll_and_cname(app, env): - # type: (Sphinx, BuildEnvironment) -> None +def create_nojekyll_and_cname(app: Sphinx, env: BuildEnvironment) -> None: if app.builder.format == 'html': open(os.path.join(app.builder.outdir, '.nojekyll'), 'wt').close() @@ -35,7 +31,6 @@ def create_nojekyll_and_cname(app, env): f.write(domain) -def setup(app): - # type: (Sphinx) -> Dict[str, Any] +def setup(app: Sphinx) -> Dict[str, Any]: app.connect('env-updated', create_nojekyll_and_cname) return {'version': sphinx.__display_version__, 'parallel_read_safe': True} |