diff options
| author | Alexander Smirnov <[email protected]> | 2024-12-19 08:16:17 +0000 |
|---|---|---|
| committer | Alexander Smirnov <[email protected]> | 2024-12-19 08:16:17 +0000 |
| commit | c1c806d731fa634503bf452ee3c603ed956abe2c (patch) | |
| tree | f2a69c7615b518119f1c895672544ce8ad1a4fe4 /contrib/python/ipython/py3/IPython/sphinxext/ipython_directive.py | |
| parent | 892a954b648dfce3da44ad433b2258e303b08b06 (diff) | |
| parent | bb0840c0025a75dd3b85b746ebcec7deb7d9fe1c (diff) | |
Merge branch 'rightlib' into mergelibs-241219-0815
Diffstat (limited to 'contrib/python/ipython/py3/IPython/sphinxext/ipython_directive.py')
| -rw-r--r-- | contrib/python/ipython/py3/IPython/sphinxext/ipython_directive.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/contrib/python/ipython/py3/IPython/sphinxext/ipython_directive.py b/contrib/python/ipython/py3/IPython/sphinxext/ipython_directive.py index 88357a51137..5561ad63b81 100644 --- a/contrib/python/ipython/py3/IPython/sphinxext/ipython_directive.py +++ b/contrib/python/ipython/py3/IPython/sphinxext/ipython_directive.py @@ -174,7 +174,7 @@ To Do # Authors # ======= -# +# # - John D Hunter: original author. # - Fernando Perez: refactoring, documentation, cleanups, port to 0.11. # - VáclavŠmilauer <eudoxos-AT-arcig.cz>: Prompt generalizations. @@ -196,6 +196,7 @@ import ast import warnings import shutil from io import StringIO +from typing import Any, Dict, Set # Third-party from docutils.parsers.rst import directives @@ -425,7 +426,7 @@ class EmbeddedSphinxShell(object): source_dir = self.source_dir saveargs = decorator.split(' ') filename = saveargs[1] - # insert relative path to image file in source + # insert relative path to image file in source # as absolute path for Sphinx # sphinx expects a posix path, even on Windows path = pathlib.Path(savefig_dir, filename) @@ -901,21 +902,22 @@ class EmbeddedSphinxShell(object): class IPythonDirective(Directive): - has_content = True - required_arguments = 0 - optional_arguments = 4 # python, suppress, verbatim, doctest - final_argumuent_whitespace = True - option_spec = { 'python': directives.unchanged, - 'suppress' : directives.flag, - 'verbatim' : directives.flag, - 'doctest' : directives.flag, - 'okexcept': directives.flag, - 'okwarning': directives.flag - } + has_content: bool = True + required_arguments: int = 0 + optional_arguments: int = 4 # python, suppress, verbatim, doctest + final_argumuent_whitespace: bool = True + option_spec: Dict[str, Any] = { + "python": directives.unchanged, + "suppress": directives.flag, + "verbatim": directives.flag, + "doctest": directives.flag, + "okexcept": directives.flag, + "okwarning": directives.flag, + } shell = None - seen_docs = set() + seen_docs: Set = set() def get_config_options(self): # contains sphinx configuration variables |
