summaryrefslogtreecommitdiff
path: root/sphinx/ext/graphviz.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-01-29 22:02:08 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-01-29 22:51:18 +0900
commitad6f11d1a827cbc69e3bebc9f79f657f812b2988 (patch)
tree64390e423adfbc278b007af89ed5d0f88dcd1b82 /sphinx/ext/graphviz.py
parent8494638e459123ec4167842f58dc20d7e30866a9 (diff)
downloadsphinx-git-ad6f11d1a827cbc69e3bebc9f79f657f812b2988.tar.gz
Fix mypy violations
Diffstat (limited to 'sphinx/ext/graphviz.py')
-rw-r--r--sphinx/ext/graphviz.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py
index 8a3dc6848..715b7ddcf 100644
--- a/sphinx/ext/graphviz.py
+++ b/sphinx/ext/graphviz.py
@@ -49,7 +49,7 @@ class ClickableMapDefinition(object):
def __init__(self, filename, content, dot=''):
# type: (unicode, unicode, unicode) -> None
- self.id = None
+ self.id = None # type: unicode
self.filename = filename
self.content = content.splitlines()
self.clickable = [] # type: List[unicode]
@@ -57,7 +57,7 @@ class ClickableMapDefinition(object):
self.parse(dot=dot)
def parse(self, dot=None):
- # type: (None) -> None
+ # type: (unicode) -> None
matched = self.maptag_re.match(self.content[0]) # type: ignore
if not matched:
raise GraphvizError('Invalid clickable map file found: %s' % self.filename)
@@ -71,11 +71,11 @@ class ClickableMapDefinition(object):
self.content[0] = self.content[0].replace('%3', self.id)
for line in self.content:
- if self.href_re.search(line):
+ if self.href_re.search(line): # type: ignore
self.clickable.append(line)
def generate_clickable_map(self):
- # type: () -> None
+ # type: () -> unicode
"""Generate clickable map tags if clickable item exists.
If not exists, this only returns empty string.
@@ -295,7 +295,7 @@ def render_dot_html(self, node, code, options, prefix='graphviz',
<p class="warning">%s</p></object>\n''' % (fname, alt)
self.body.append(svgtag)
else:
- with codecs.open(outfn + '.map', 'r', encoding='utf-8') as mapfile:
+ with codecs.open(outfn + '.map', 'r', encoding='utf-8') as mapfile: # type: ignore
imgmap = ClickableMapDefinition(outfn + '.map', mapfile.read(), dot=code)
if imgmap.clickable:
# has a map