##// END OF EJS Templates
FIX: Typing annotations...
farisachugthai -
Show More
@@ -107,7 +107,7 b' def float_doctest(sphinx_shell, args, input_lines, found, submitted):'
107 try:
107 try:
108 rtol = float(args[2])
108 rtol = float(args[2])
109 atol = float(args[3])
109 atol = float(args[3])
110 except IndexError as e:
110 except IndexError:
111 e = ("Both `rtol` and `atol` must be specified "
111 e = ("Both `rtol` and `atol` must be specified "
112 "if either are specified: {0}".format(args))
112 "if either are specified: {0}".format(args))
113 raise IndexError(e) from e
113 raise IndexError(e) from e
@@ -174,7 +174,7 b' To Do'
174
174
175 # Authors
175 # Authors
176 # =======
176 # =======
177 #
177 #
178 # - John D Hunter: original author.
178 # - John D Hunter: original author.
179 # - Fernando Perez: refactoring, documentation, cleanups, port to 0.11.
179 # - Fernando Perez: refactoring, documentation, cleanups, port to 0.11.
180 # - VΓ‘clavΕ milauer <eudoxos-AT-arcig.cz>: Prompt generalizations.
180 # - VΓ‘clavΕ milauer <eudoxos-AT-arcig.cz>: Prompt generalizations.
@@ -196,6 +196,7 b' import ast'
196 import warnings
196 import warnings
197 import shutil
197 import shutil
198 from io import StringIO
198 from io import StringIO
199 from typing import Any, Dict, Set
199
200
200 # Third-party
201 # Third-party
201 from docutils.parsers.rst import directives
202 from docutils.parsers.rst import directives
@@ -425,7 +426,7 b' class EmbeddedSphinxShell(object):'
425 source_dir = self.source_dir
426 source_dir = self.source_dir
426 saveargs = decorator.split(' ')
427 saveargs = decorator.split(' ')
427 filename = saveargs[1]
428 filename = saveargs[1]
428 # insert relative path to image file in source
429 # insert relative path to image file in source
429 # as absolute path for Sphinx
430 # as absolute path for Sphinx
430 # sphinx expects a posix path, even on Windows
431 # sphinx expects a posix path, even on Windows
431 path = pathlib.Path(savefig_dir, filename)
432 path = pathlib.Path(savefig_dir, filename)
@@ -901,11 +902,11 b' class EmbeddedSphinxShell(object):'
901
902
902 class IPythonDirective(Directive):
903 class IPythonDirective(Directive):
903
904
904 has_content = True
905 has_content: bool = True
905 required_arguments = 0
906 required_arguments: int = 0
906 optional_arguments = 4 # python, suppress, verbatim, doctest
907 optional_arguments: int = 4 # python, suppress, verbatim, doctest
907 final_argumuent_whitespace = True
908 final_argumuent_whitespace: bool = True
908 option_spec = { 'python': directives.unchanged,
909 option_spec: Dict[str, Any] = { 'python': directives.unchanged,
909 'suppress' : directives.flag,
910 'suppress' : directives.flag,
910 'verbatim' : directives.flag,
911 'verbatim' : directives.flag,
911 'doctest' : directives.flag,
912 'doctest' : directives.flag,
@@ -915,7 +916,7 b' class IPythonDirective(Directive):'
915
916
916 shell = None
917 shell = None
917
918
918 seen_docs = set()
919 seen_docs: Set = set()
919
920
920 def get_config_options(self):
921 def get_config_options(self):
921 # contains sphinx configuration variables
922 # contains sphinx configuration variables
General Comments 0
You need to be logged in to leave comments. Login now