diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-12-18 11:04:10 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-12-18 11:18:13 +0300 |
commit | dcbf444872b81248ce958f05d47abad6e8a237a7 (patch) | |
tree | a93610b3dd80f19c5116e4e5885ea2783f6166d3 /contrib/python/ipython/py3/IPython/sphinxext/ipython_directive.py | |
parent | e2c38d5aa55a58da33c1dc54792c131023bb7472 (diff) | |
download | ydb-dcbf444872b81248ce958f05d47abad6e8a237a7.tar.gz |
Intermediate changes
commit_hash:1f2ebe313aea1039145a9d68dcd511d5f22f383a
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 88357a5113..5561ad63b8 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 |