diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index 1b1bf2d88d..1a24057bc0 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -18,6 +18,7 @@ from sphinx.deprecation import RemovedInSphinx30Warning if False: # For type annotation from typing import List, Sequence # NOQA + from sphinx.util.typing import unicode # NOQA class translatable: diff --git a/sphinx/application.py b/sphinx/application.py index c60f12e96f..685aff1cb5 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -60,7 +60,7 @@ if False: from sphinx.extension import Extension # NOQA from sphinx.roles import XRefRole # NOQA from sphinx.theming import Theme # NOQA - from sphinx.util.typing import RoleFunction, TitleGetter # NOQA + from sphinx.util.typing import RoleFunction, TitleGetter, unicode # NOQA builtin_extensions = ( 'sphinx.builders.applehelp', diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 7f12e45643..16ec3e50d4 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -47,6 +47,7 @@ if False: from sphinx.environment import BuildEnvironment # NOQA from sphinx.util.i18n import CatalogInfo # NOQA from sphinx.util.tags import Tags # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/_epub_base.py b/sphinx/builders/_epub_base.py index eaab43fdab..300ce602e0 100644 --- a/sphinx/builders/_epub_base.py +++ b/sphinx/builders/_epub_base.py @@ -39,6 +39,7 @@ if False: # For type annotation from typing import Any, Dict, List, Tuple # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/applehelp.py b/sphinx/builders/applehelp.py index b29ce3d950..309053d568 100644 --- a/sphinx/builders/applehelp.py +++ b/sphinx/builders/applehelp.py @@ -31,6 +31,7 @@ if False: # For type annotation from typing import Any, Dict # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py index 888a011dad..cf68e5dfa9 100644 --- a/sphinx/builders/changes.py +++ b/sphinx/builders/changes.py @@ -27,6 +27,7 @@ if False: # For type annotation from typing import Any, Dict, List, Tuple # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/devhelp.py b/sphinx/builders/devhelp.py index f81154984d..d6acefb6d1 100644 --- a/sphinx/builders/devhelp.py +++ b/sphinx/builders/devhelp.py @@ -36,6 +36,7 @@ if False: # For type annotation from typing import Dict, List # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/dummy.py b/sphinx/builders/dummy.py index 805924290e..9ab1ad1553 100644 --- a/sphinx/builders/dummy.py +++ b/sphinx/builders/dummy.py @@ -18,6 +18,7 @@ if False: from typing import Any, Dict, Set # NOQA from docutils import nodes # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA class DummyBuilder(Builder): diff --git a/sphinx/builders/epub3.py b/sphinx/builders/epub3.py index 8e3028bf55..3e4785044d 100644 --- a/sphinx/builders/epub3.py +++ b/sphinx/builders/epub3.py @@ -28,6 +28,7 @@ if False: from docutils import nodes # NOQA from sphinx.application import Sphinx # NOQA from sphinx.config import Config # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py index 55da817af6..0f7d51d0da 100644 --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -35,8 +35,9 @@ if False: # For type annotation from typing import Any, DefaultDict, Dict, Iterable, List, Set, Tuple # NOQA from docutils import nodes # NOQA - from sphinx.util.i18n import CatalogInfo # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.i18n import CatalogInfo # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 2a0170473f..f045ef068e 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -60,6 +60,7 @@ if False: from sphinx.config import Config # NOQA from sphinx.domains import Domain, Index, IndexEntry # NOQA from sphinx.util.tags import Tags # NOQA + from sphinx.util.typing import unicode # NOQA # Experimental HTML5 Writer if is_html5_writer_available(): @@ -675,7 +676,7 @@ class StandaloneHTMLBuilder(Builder): doctree.settings = self.docsettings self.secnumbers = self.env.toc_secnumbers.get(docname, {}) - self.fignumbers = self.env.toc_fignumbers.get(docname, {}) # type: Dict[unicode, Dict[unicode, Tuple[int, ...]]] # NOQA + self.fignumbers = self.env.toc_fignumbers.get(docname, {}) self.imgpath = relative_uri(self.get_target_uri(docname), '_images') self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads') # type: unicode self.current_docname = docname diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py index 252e5050de..ce8a8956ff 100644 --- a/sphinx/builders/htmlhelp.py +++ b/sphinx/builders/htmlhelp.py @@ -29,6 +29,7 @@ if False: # For type annotation from typing import Any, Dict, IO, List, Tuple # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/latex/__init__.py b/sphinx/builders/latex/__init__.py index c4335885f7..817eab1d78 100644 --- a/sphinx/builders/latex/__init__.py +++ b/sphinx/builders/latex/__init__.py @@ -45,6 +45,7 @@ if False: from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA from sphinx.application import Sphinx # NOQA from sphinx.config import Config # NOQA + from sphinx.util.typing import unicode # NOQA XINDY_LANG_OPTIONS = { diff --git a/sphinx/builders/latex/transforms.py b/sphinx/builders/latex/transforms.py index c95886e7ec..5a46c17f2c 100644 --- a/sphinx/builders/latex/transforms.py +++ b/sphinx/builders/latex/transforms.py @@ -21,6 +21,7 @@ from sphinx.util.nodes import NodeMatcher if False: # For type annotation from typing import Any, Dict, List, Set, Tuple, Union # NOQA + from sphinx.util.typing import unicode # NOQA URI_SCHEMES = ('mailto:', 'http:', 'https:', 'ftp:') diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index 870190fb72..13d2f3f44b 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -33,6 +33,7 @@ if False: from typing import Any, Dict, List, Set, Tuple, Union # NOQA from sphinx.application import Sphinx # NOQA from sphinx.util.requests.requests import Response # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/manpage.py b/sphinx/builders/manpage.py index a7bbe782d2..3982c902ed 100644 --- a/sphinx/builders/manpage.py +++ b/sphinx/builders/manpage.py @@ -28,6 +28,7 @@ if False: # For type annotation from typing import Any, Dict, List, Set, Union # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py index 679372cd57..941be76c99 100644 --- a/sphinx/builders/qthelp.py +++ b/sphinx/builders/qthelp.py @@ -31,6 +31,7 @@ if False: # For type annotation from typing import Any, Dict, List, Tuple # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/texinfo.py b/sphinx/builders/texinfo.py index 5a2956b515..f15e0d1ce7 100644 --- a/sphinx/builders/texinfo.py +++ b/sphinx/builders/texinfo.py @@ -35,6 +35,7 @@ if False: # For type annotation from sphinx.application import Sphinx # NOQA from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/text.py b/sphinx/builders/text.py index a43332971a..cad379cf43 100644 --- a/sphinx/builders/text.py +++ b/sphinx/builders/text.py @@ -24,6 +24,7 @@ if False: from typing import Any, Dict, Iterator, Set, Tuple # NOQA from docutils import nodes # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/builders/websupport.py b/sphinx/builders/websupport.py index 1fe9e20014..077c1bdc27 100644 --- a/sphinx/builders/websupport.py +++ b/sphinx/builders/websupport.py @@ -13,6 +13,7 @@ if False: # For type annotation from typing import Any, Dict # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA def setup(app): diff --git a/sphinx/builders/xml.py b/sphinx/builders/xml.py index 03aefe0063..4bc0d27e20 100644 --- a/sphinx/builders/xml.py +++ b/sphinx/builders/xml.py @@ -25,6 +25,7 @@ if False: # For type annotation from typing import Any, Dict, Iterator, Set # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/cmd/make_mode.py b/sphinx/cmd/make_mode.py index 447b2ed010..27c4165ab9 100644 --- a/sphinx/cmd/make_mode.py +++ b/sphinx/cmd/make_mode.py @@ -29,6 +29,7 @@ from sphinx.util.osutil import cd, rmtree if False: # For type annotation from typing import List # NOQA + from sphinx.util.typing import unicode # NOQA BUILDERS = [ diff --git a/sphinx/cmd/quickstart.py b/sphinx/cmd/quickstart.py index 6d2211720b..b7e67ec8eb 100644 --- a/sphinx/cmd/quickstart.py +++ b/sphinx/cmd/quickstart.py @@ -51,6 +51,7 @@ from sphinx.util.template import SphinxRenderer if False: # For type annotation from typing import Any, Callable, Dict, List, Pattern, Union # NOQA + from sphinx.util.typing import unicode # NOQA TERM_ENCODING = getattr(sys.stdin, 'encoding', None) diff --git a/sphinx/config.py b/sphinx/config.py index 5948becf4e..7225929052 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -33,6 +33,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA from sphinx.util.tags import Tags # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/deprecation.py b/sphinx/deprecation.py index d5827ddc00..ebf053e7bb 100644 --- a/sphinx/deprecation.py +++ b/sphinx/deprecation.py @@ -15,6 +15,7 @@ if False: # For type annotation # note: Don't use typing.TYPE_CHECK here (for py27 and py34). from typing import Any, Dict, Type # NOQA + from sphinx.util.typing import unicode # NOQA class RemovedInSphinx30Warning(PendingDeprecationWarning): diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py index 1898a1c0ca..c54c6ed4d9 100644 --- a/sphinx/directives/__init__.py +++ b/sphinx/directives/__init__.py @@ -36,6 +36,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.config import Config # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA # RE to strip backslash escapes diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index e9f178b5e0..1d12165d3c 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -29,6 +29,7 @@ if False: from typing import Any, Dict, List, Tuple # NOQA from sphinx.application import Sphinx # NOQA from sphinx.config import Config # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py index 2c9d8ea1d0..8045770844 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -28,6 +28,7 @@ if False: # For type annotation from typing import Any, Dict, Generator, List, Tuple # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA glob_re = re.compile(r'.*[*?\[].*') diff --git a/sphinx/directives/patches.py b/sphinx/directives/patches.py index 1c90d53138..2ae2b401b5 100644 --- a/sphinx/directives/patches.py +++ b/sphinx/directives/patches.py @@ -20,6 +20,7 @@ if False: # For type annotation from typing import Dict, List, Tuple # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA class Figure(images.Figure): diff --git a/sphinx/domains/__init__.py b/sphinx/domains/__init__.py index 6189a1b400..5704b56de4 100644 --- a/sphinx/domains/__init__.py +++ b/sphinx/domains/__init__.py @@ -25,7 +25,7 @@ if False: from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA from sphinx.roles import XRefRole # NOQA - from sphinx.util.typing import RoleFunction # NOQA + from sphinx.util.typing import RoleFunction, unicode # NOQA class ObjType: diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py index e4a71c8a7d..a7e91da1f1 100644 --- a/sphinx/domains/c.py +++ b/sphinx/domains/c.py @@ -28,6 +28,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA # RE to split at word boundaries diff --git a/sphinx/domains/changeset.py b/sphinx/domains/changeset.py index b51d0b3656..be974e6358 100644 --- a/sphinx/domains/changeset.py +++ b/sphinx/domains/changeset.py @@ -27,6 +27,7 @@ if False: from typing import Any, Dict, List # NOQA from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA versionlabels = { diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index a821b25e4f..fef62c2bd0 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -36,6 +36,7 @@ if False: from sphinx.builders import Builder # NOQA from sphinx.config import Config # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py index 04c1ea2631..a552c8f04d 100644 --- a/sphinx/domains/javascript.py +++ b/sphinx/domains/javascript.py @@ -29,6 +29,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA class JSObject(ObjectDescription): diff --git a/sphinx/domains/math.py b/sphinx/domains/math.py index 664082abe7..7a1348ed1b 100644 --- a/sphinx/domains/math.py +++ b/sphinx/domains/math.py @@ -26,6 +26,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index 4300f91826..8320f83de6 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -31,6 +31,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/domains/rst.py b/sphinx/domains/rst.py index d42c5026aa..344ca6bcd4 100644 --- a/sphinx/domains/rst.py +++ b/sphinx/domains/rst.py @@ -25,6 +25,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$') diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index 4eb289cc66..55e03c87a4 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -36,7 +36,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA - from sphinx.util.typing import RoleFunction # NOQA + from sphinx.util.typing import RoleFunction, unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index ba137e30d8..440160d36f 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -40,6 +40,7 @@ if False: from sphinx.config import Config # NOQA from sphinx.domains import Domain # NOQA from sphinx.project import Project # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/environment/adapters/asset.py b/sphinx/environment/adapters/asset.py index fa1141f651..d1e7ab9950 100644 --- a/sphinx/environment/adapters/asset.py +++ b/sphinx/environment/adapters/asset.py @@ -12,6 +12,7 @@ if False: # For type annotation from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA class ImageAdapter: diff --git a/sphinx/environment/adapters/indexentries.py b/sphinx/environment/adapters/indexentries.py index d39fb057d0..5235ef7067 100644 --- a/sphinx/environment/adapters/indexentries.py +++ b/sphinx/environment/adapters/indexentries.py @@ -23,6 +23,7 @@ if False: from typing import Any, Dict, Pattern, List, Tuple # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/environment/adapters/toctree.py b/sphinx/environment/adapters/toctree.py index 4b051eb0a4..18d95732d0 100644 --- a/sphinx/environment/adapters/toctree.py +++ b/sphinx/environment/adapters/toctree.py @@ -22,6 +22,7 @@ if False: from typing import Any, Dict, List # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/environment/collectors/__init__.py b/sphinx/environment/collectors/__init__.py index 30e1e9480d..6f0e065fc2 100644 --- a/sphinx/environment/collectors/__init__.py +++ b/sphinx/environment/collectors/__init__.py @@ -15,6 +15,7 @@ if False: from docutils import nodes # NOQA from sphinx.sphinx import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA class EnvironmentCollector: diff --git a/sphinx/environment/collectors/asset.py b/sphinx/environment/collectors/asset.py index d41931ed37..22d2af532f 100644 --- a/sphinx/environment/collectors/asset.py +++ b/sphinx/environment/collectors/asset.py @@ -29,6 +29,7 @@ if False: from docutils import nodes # NOQA from sphinx.sphinx import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/environment/collectors/dependencies.py b/sphinx/environment/collectors/dependencies.py index 761a51e385..018ec0b0f5 100644 --- a/sphinx/environment/collectors/dependencies.py +++ b/sphinx/environment/collectors/dependencies.py @@ -23,6 +23,7 @@ if False: from docutils import nodes # NOQA from sphinx.sphinx import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA class DependenciesCollector(EnvironmentCollector): diff --git a/sphinx/environment/collectors/indexentries.py b/sphinx/environment/collectors/indexentries.py index 2a5abcc8eb..ef3de3a5d2 100644 --- a/sphinx/environment/collectors/indexentries.py +++ b/sphinx/environment/collectors/indexentries.py @@ -21,6 +21,7 @@ if False: from docutils import nodes # NOQA from sphinx.applicatin import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/environment/collectors/metadata.py b/sphinx/environment/collectors/metadata.py index 7d54d2fe69..446e22751f 100644 --- a/sphinx/environment/collectors/metadata.py +++ b/sphinx/environment/collectors/metadata.py @@ -19,6 +19,7 @@ if False: from docutils import nodes # NOQA from sphinx.sphinx import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA class MetadataCollector(EnvironmentCollector): diff --git a/sphinx/environment/collectors/title.py b/sphinx/environment/collectors/title.py index eb23b975f8..c786f04921 100644 --- a/sphinx/environment/collectors/title.py +++ b/sphinx/environment/collectors/title.py @@ -20,6 +20,7 @@ if False: from docutils import nodes # NOQA from sphinx.sphinx import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA class TitleCollector(EnvironmentCollector): diff --git a/sphinx/environment/collectors/toctree.py b/sphinx/environment/collectors/toctree.py index 462997164e..5c2ef483c6 100644 --- a/sphinx/environment/collectors/toctree.py +++ b/sphinx/environment/collectors/toctree.py @@ -24,6 +24,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/errors.py b/sphinx/errors.py index 43b63ea052..dead3f1c83 100644 --- a/sphinx/errors.py +++ b/sphinx/errors.py @@ -13,6 +13,7 @@ if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA class SphinxError(Exception): diff --git a/sphinx/events.py b/sphinx/events.py index 0b76d6c9e5..fca304773d 100644 --- a/sphinx/events.py +++ b/sphinx/events.py @@ -20,6 +20,7 @@ from sphinx.locale import __ if False: # For type annotation from typing import Any, Callable, Dict, List # NOQA + from sphinx.util.typing import unicode # NOQA # List of all known core events. Maps name to arguments description. diff --git a/sphinx/ext/apidoc.py b/sphinx/ext/apidoc.py index 7c407e9336..85a41e6500 100644 --- a/sphinx/ext/apidoc.py +++ b/sphinx/ext/apidoc.py @@ -35,6 +35,7 @@ from sphinx.util.osutil import FileAvoidWrite, ensuredir if False: # For type annotation from typing import Any, List, Tuple # NOQA + from sphinx.util.typing import unicode # NOQA # automodule options if 'SPHINX_APIDOC_OPTIONS' in os.environ: diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index 2fd388c8f5..607c716124 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -43,6 +43,7 @@ if False: from sphinx.config import Config # NOQA from sphinx.environment import BuildEnvironment # NOQA from sphinx.ext.autodoc.directive import DocumenterBridge # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py index cf1f2f47f4..303e9ab542 100644 --- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ -24,6 +24,7 @@ if False: from sphinx.config import Config # NOQA from sphinx.environment import BuildEnvironment # NOQA from sphinx.ext.autodoc import Documenter # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/autodoc/importer.py b/sphinx/ext/autodoc/importer.py index 45bab042bd..47f2df9155 100644 --- a/sphinx/ext/autodoc/importer.py +++ b/sphinx/ext/autodoc/importer.py @@ -22,6 +22,7 @@ from sphinx.util.inspect import isenumclass, safe_getattr if False: # For type annotation from typing import Any, Callable, Dict, Generator, Iterator, List, Optional, Tuple # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/autosectionlabel.py b/sphinx/ext/autosectionlabel.py index 5713828a42..459817a4ce 100644 --- a/sphinx/ext/autosectionlabel.py +++ b/sphinx/ext/autosectionlabel.py @@ -27,6 +27,7 @@ if False: # For type annotation from typing import Any, Dict # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA def register_sections_as_label(app, document): diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py index f49725f392..adcf4e5b29 100644 --- a/sphinx/ext/autosummary/__init__.py +++ b/sphinx/ext/autosummary/__init__.py @@ -87,6 +87,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA from sphinx.ext.autodoc import Documenter # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py index 20a06aeb42..66fc04d058 100644 --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -48,6 +48,7 @@ if False: from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA from sphinx.ext.autodoc import Documenter # NOQA + from sphinx.util.typing import unicode # NOQA class DummyApplication: diff --git a/sphinx/ext/coverage.py b/sphinx/ext/coverage.py index 76b721adfb..3045c8c87a 100644 --- a/sphinx/ext/coverage.py +++ b/sphinx/ext/coverage.py @@ -26,6 +26,7 @@ if False: # For type annotation from typing import Any, Callable, Dict, IO, List, Pattern, Set, Tuple # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/doctest.py b/sphinx/ext/doctest.py index 0f706ae874..f74e9e32eb 100644 --- a/sphinx/ext/doctest.py +++ b/sphinx/ext/doctest.py @@ -38,6 +38,7 @@ if False: # For type annotation from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Sequence, Set, Tuple # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/extlinks.py b/sphinx/ext/extlinks.py index 106748dbb5..ea1c32f3c6 100644 --- a/sphinx/ext/extlinks.py +++ b/sphinx/ext/extlinks.py @@ -35,6 +35,7 @@ if False: from docutils.parsers.rst.states import Inliner # NOQA from sphinx.application import Sphinx # NOQA from sphinx.util.typing import RoleFunction # NOQA + from sphinx.util.typing import unicode # NOQA def make_link_role(base_url, prefix): diff --git a/sphinx/ext/githubpages.py b/sphinx/ext/githubpages.py index bd7061fb73..f11846e081 100644 --- a/sphinx/ext/githubpages.py +++ b/sphinx/ext/githubpages.py @@ -18,6 +18,7 @@ if False: from typing import Any, Dict # NOQA from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA def create_nojekyll(app, env): diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py index ae10b2c25b..732e87cee8 100644 --- a/sphinx/ext/graphviz.py +++ b/sphinx/ext/graphviz.py @@ -35,6 +35,7 @@ if False: from docutils.parsers.rst import Directive # NOQA from typing import Any, Dict, List, Tuple # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/ifconfig.py b/sphinx/ext/ifconfig.py index f22a37e923..a66023107d 100644 --- a/sphinx/ext/ifconfig.py +++ b/sphinx/ext/ifconfig.py @@ -30,6 +30,7 @@ if False: # For type annotation from typing import Any, Dict, List # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA class ifconfig(nodes.Element): diff --git a/sphinx/ext/imgconverter.py b/sphinx/ext/imgconverter.py index fe086b1fe8..b651e6b69c 100644 --- a/sphinx/ext/imgconverter.py +++ b/sphinx/ext/imgconverter.py @@ -21,6 +21,7 @@ if False: # For type annotation from typing import Any, Dict # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/imgmath.py b/sphinx/ext/imgmath.py index 14db7e739c..87e84f36fe 100644 --- a/sphinx/ext/imgmath.py +++ b/sphinx/ext/imgmath.py @@ -36,6 +36,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.config import Config # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py index 12cdbff5b2..81a90aabe1 100644 --- a/sphinx/ext/inheritance_diagram.py +++ b/sphinx/ext/inheritance_diagram.py @@ -55,6 +55,7 @@ if False: from typing import Any, Dict, List, Tuple, Dict, Optional # NOQA from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA module_sig_re = re.compile(r'''^(?:([\w.]*)\.)? # module names diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py index e144adf84d..804124897e 100644 --- a/sphinx/ext/intersphinx.py +++ b/sphinx/ext/intersphinx.py @@ -49,6 +49,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.config import Config # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA Inventory = Dict[text_type, Dict[text_type, Tuple[text_type, text_type, text_type, text_type]]] # NOQA diff --git a/sphinx/ext/jsmath.py b/sphinx/ext/jsmath.py index e033518005..0df5d44137 100644 --- a/sphinx/ext/jsmath.py +++ b/sphinx/ext/jsmath.py @@ -23,6 +23,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA from sphinx.writers.html import HTMLTranslator # NOQA + from sphinx.util.typing import unicode # NOQA def html_visit_math(self, node): diff --git a/sphinx/ext/linkcode.py b/sphinx/ext/linkcode.py index 6e16a1ac5e..6ac37f7fe1 100644 --- a/sphinx/ext/linkcode.py +++ b/sphinx/ext/linkcode.py @@ -20,6 +20,7 @@ if False: # For type annotation from typing import Any, Dict, Set # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA class LinkcodeError(SphinxError): diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py index 076edaf371..185e359560 100644 --- a/sphinx/ext/mathbase.py +++ b/sphinx/ext/mathbase.py @@ -26,6 +26,7 @@ if False: from typing import Any, Callable, List, Tuple # NOQA from docutils.writers.html4css1 import Writer # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA class MathDirective(MathDirectiveBase): diff --git a/sphinx/ext/mathjax.py b/sphinx/ext/mathjax.py index 3786c81071..e8c0d4b44b 100644 --- a/sphinx/ext/mathjax.py +++ b/sphinx/ext/mathjax.py @@ -26,6 +26,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA from sphinx.writers.html import HTMLTranslator # NOQA + from sphinx.util.typing import unicode # NOQA def html_visit_math(self, node): diff --git a/sphinx/ext/napoleon/__init__.py b/sphinx/ext/napoleon/__init__.py index 00b78e8599..cbe02b0152 100644 --- a/sphinx/ext/napoleon/__init__.py +++ b/sphinx/ext/napoleon/__init__.py @@ -16,6 +16,7 @@ from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring if False: # For type annotation from typing import Any, Dict, List # NOQA + from sphinx.util.typing import unicode # NOQA class Config: diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py index 9841f54629..6a4778b527 100644 --- a/sphinx/ext/napoleon/docstring.py +++ b/sphinx/ext/napoleon/docstring.py @@ -25,6 +25,7 @@ if False: from typing import Any, Dict, List, Tuple, Type, Union # NOQA from sphinx.application import Sphinx # NOQA from sphinx.config import Config as SphinxConfig # NOQA + from sphinx.util.typing import unicode # NOQA _directive_regex = re.compile(r'\.\. \S+::') diff --git a/sphinx/ext/todo.py b/sphinx/ext/todo.py index d7413ac61f..7585b0f2bc 100644 --- a/sphinx/ext/todo.py +++ b/sphinx/ext/todo.py @@ -29,6 +29,7 @@ if False: from typing import Any, Dict, Iterable, List # NOQA from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py index e3d21e3616..927a807c6f 100644 --- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ -29,6 +29,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.config import Config # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/extension.py b/sphinx/extension.py index 4282d5f07a..c6f1d044f1 100644 --- a/sphinx/extension.py +++ b/sphinx/extension.py @@ -18,6 +18,7 @@ if False: from typing import Any, Dict # NOQA from sphinx.application import Sphinx # NOQA from sphinx.config import Config # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index 8bd12c9912..27a2c9babb 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -34,6 +34,7 @@ if False: # For type annotation from typing import Any, Dict # NOQA from pygments.formatter import Formatter # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/io.py b/sphinx/io.py index de6432983c..28fb724bc2 100644 --- a/sphinx/io.py +++ b/sphinx/io.py @@ -49,6 +49,7 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA docinfo_re = re.compile(':\\w+:.*?') diff --git a/sphinx/jinja2glue.py b/sphinx/jinja2glue.py index 739437a16d..b6826f3dbf 100644 --- a/sphinx/jinja2glue.py +++ b/sphinx/jinja2glue.py @@ -28,6 +28,7 @@ if False: from jinja2.environment import Environment # NOQA from sphinx.builders import Builder # NOQA from sphinx.theming import Theme # NOQA + from sphinx.util.typing import unicode # NOQA def _tobool(val): diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py index 34aafffe6b..2ee353d766 100644 --- a/sphinx/locale/__init__.py +++ b/sphinx/locale/__init__.py @@ -23,6 +23,7 @@ from sphinx.deprecation import RemovedInSphinx30Warning if False: # For type annotation from typing import Any, Callable, Dict, Iterator, List, Tuple # NOQA + from sphinx.util.typing import unicode # NOQA class _TranslationProxy(UserString): diff --git a/sphinx/parsers.py b/sphinx/parsers.py index 9b1fef7027..510d20bcc5 100644 --- a/sphinx/parsers.py +++ b/sphinx/parsers.py @@ -21,6 +21,7 @@ if False: from docutils import nodes # NOQA from docutils.transforms import Transform # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.util.typing import unicode # NOQA class Parser(docutils.parsers.Parser): diff --git a/sphinx/project.py b/sphinx/project.py index 82ea54ef38..b0277723f6 100644 --- a/sphinx/project.py +++ b/sphinx/project.py @@ -20,6 +20,7 @@ from sphinx.util.osutil import SEP, relpath if TYPE_CHECKING: from typing import Dict, List, Set # NOQA + from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) EXCLUDE_PATHS = ['**/_sources', '.#*', '**/.#*', '*.lproj/**'] # type: List[unicode] diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py index 3bd49a3058..fe6b5f7e18 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -23,6 +23,7 @@ from sphinx.util import get_module_source, detect_encoding if False: # For type annotation from typing import Any, Dict, IO, List, Tuple # NOQA + from sphinx.util.typing import unicode # NOQA class ModuleAnalyzer: diff --git a/sphinx/pycode/parser.py b/sphinx/pycode/parser.py index e1aa1f5041..9b26650825 100644 --- a/sphinx/pycode/parser.py +++ b/sphinx/pycode/parser.py @@ -22,6 +22,7 @@ from six import text_type if False: # For type annotation from typing import Any, Dict, IO, List, Tuple # NOQA + from sphinx.util.typing import unicode # NOQA comment_re = re.compile(u'^\\s*#: ?(.*)\r?\n?$') indent_re = re.compile(u'^\\s*$') @@ -143,7 +144,7 @@ class TokenProcessor: # type: (List[unicode]) -> None lines = iter(buffers) self.buffers = buffers - self.tokens = tokenize.generate_tokens(lambda: next(lines)) # type: ignore # NOQA + self.tokens = tokenize.generate_tokens(lambda: next(lines)) # type: ignore self.current = None # type: Token self.previous = None # type: Token diff --git a/sphinx/registry.py b/sphinx/registry.py index 1ffece84cb..249b6ea524 100644 --- a/sphinx/registry.py +++ b/sphinx/registry.py @@ -43,7 +43,7 @@ if False: from sphinx.domains import Domain, Index # NOQA from sphinx.environment import BuildEnvironment # NOQA from sphinx.ext.autodoc import Documenter # NOQA - from sphinx.util.typing import RoleFunction, TitleGetter # NOQA + from sphinx.util.typing import RoleFunction, TitleGetter, unicode # NOQA logger = logging.getLogger(__name__) diff --git a/sphinx/roles.py b/sphinx/roles.py index 454dcb8022..30b41438f1 100644 --- a/sphinx/roles.py +++ b/sphinx/roles.py @@ -26,7 +26,7 @@ if False: from docutils.parsers.rst.states import Inliner # NOQA from sphinx.application import Sphinx # NOQA from sphinx.environment import BuildEnvironment # NOQA - from sphinx.util.typing import RoleFunction # NOQA + from sphinx.util.typing import RoleFunction, unicode # NOQA generic_docroles = { diff --git a/sphinx/search/__init__.py b/sphinx/search/__init__.py index f921200101..3184e2568f 100644 --- a/sphinx/search/__init__.py +++ b/sphinx/search/__init__.py @@ -26,6 +26,7 @@ if False: from typing import Any, Dict, IO, Iterable, List, Tuple, Type, Set # NOQA from docutils import nodes # NOQA from sphinx.environment import BuildEnvironment # NOQA + from sphinx.util.typing import unicode # NOQA class SearchLanguage: diff --git a/sphinx/search/da.py b/sphinx/search/da.py index eb7394b5e9..3ab763ec5f 100644 --- a/sphinx/search/da.py +++ b/sphinx/search/da.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA danish_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/de.py b/sphinx/search/de.py index 90fc4d0fee..df758d697f 100644 --- a/sphinx/search/de.py +++ b/sphinx/search/de.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA german_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/en.py b/sphinx/search/en.py index fe9b7d8da6..384c2bb48c 100644 --- a/sphinx/search/en.py +++ b/sphinx/search/en.py @@ -15,6 +15,7 @@ from sphinx.util.stemmer import get_stemmer if False: # For type annotation from typing import Dict # NOQA + from sphinx.util.typing import unicode # NOQA english_stopwords = set(u""" a and are as at diff --git a/sphinx/search/es.py b/sphinx/search/es.py index 6fda9caba5..8e7f449837 100644 --- a/sphinx/search/es.py +++ b/sphinx/search/es.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA spanish_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/fi.py b/sphinx/search/fi.py index bf757d54a1..b92bb450b1 100644 --- a/sphinx/search/fi.py +++ b/sphinx/search/fi.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA finnish_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/fr.py b/sphinx/search/fr.py index 9976c1ca71..6d23fa6851 100644 --- a/sphinx/search/fr.py +++ b/sphinx/search/fr.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA french_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/hu.py b/sphinx/search/hu.py index 03cbf8c291..77b9d5dac4 100644 --- a/sphinx/search/hu.py +++ b/sphinx/search/hu.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA hungarian_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/it.py b/sphinx/search/it.py index 860ab93257..800aa6df4d 100644 --- a/sphinx/search/it.py +++ b/sphinx/search/it.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA italian_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/ja.py b/sphinx/search/ja.py index 84725e6a74..0a1b389c37 100644 --- a/sphinx/search/ja.py +++ b/sphinx/search/ja.py @@ -42,6 +42,7 @@ from sphinx.util import import_object if False: # For type annotation from typing import Any, Dict, List # NOQA + from sphinx.util.typing import unicode # NOQA class BaseSplitter: diff --git a/sphinx/search/nl.py b/sphinx/search/nl.py index de4fd13ecd..0ed58a485e 100644 --- a/sphinx/search/nl.py +++ b/sphinx/search/nl.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA dutch_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/no.py b/sphinx/search/no.py index 81876bcdd6..cf689f4732 100644 --- a/sphinx/search/no.py +++ b/sphinx/search/no.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA norwegian_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/pt.py b/sphinx/search/pt.py index 9afe808703..94d72bb498 100644 --- a/sphinx/search/pt.py +++ b/sphinx/search/pt.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Any # NOQA + from sphinx.util.typing import unicode # NOQA portuguese_stopwords = parse_stop_word(u''' diff --git a/sphinx/search/ro.py b/sphinx/search/ro.py index 69d6edd8e1..1ff72c207e 100644 --- a/sphinx/search/ro.py +++ b/sphinx/search/ro.py @@ -16,6 +16,7 @@ import snowballstemmer if False: # For type annotation from typing import Dict, Set # NOQA + from sphinx.util.typing import unicode # NOQA js_stemmer = u""" var JSX={};(function(j){function l(b,e){var a=function(){};a.prototype=e.prototype;var c=new a;for(var d in b){b[d].prototype=c}}function L(c,b){for(var a in b.prototype)if(b.prototype.hasOwnProperty(a))c.prototype[a]=b.prototype[a]}function h(a,b,d){function c(a,b,c){delete a[b];a[b]=c;return c}Object.defineProperty(a,b,{get:function(){return c(a,b,d())},set:function(d){c(a,b,d)},enumerable:true,configurable:true})}function M(a,b,c){return a[b]=a[b]/c|0}var E=parseInt;var C=parseFloat;function N(a){return a!==a}var A=isFinite;var z=encodeURIComponent;var y=decodeURIComponent;var x=encodeURI;var w=decodeURI;var u=Object.prototype.toString;var D=Object.prototype.hasOwnProperty;function k(){}j.require=function(b){var a=r[b];return a!==undefined?a:null};j.profilerIsRunning=function(){return k.getResults!=null};j.getProfileResults=function(){return(k.getResults||function(){return{}})()};j.postProfileResults=function(a,b){if(k.postResults==null)throw new Error('profiler has not been turned on');return k.postResults(a,b)};j.resetProfileResults=function(){if(k.resetResults==null)throw new Error('profiler has not been turned on');return k.resetResults()};j.DEBUG=false;function t(){};l([t],Error);function a(a,b,c){this.F=a.length;this.K=a;this.L=b;this.I=c;this.H=null;this.P=null};l([a],Object);function n(){};l([n],Object);function g(){var a;var b;var c;this.G={};a=this.E='';b=this._=0;c=this.A=a.length;this.D=0;this.B=b;this.C=c};l([g],n);function v(a,b){a.E=b.E;a._=b._;a.A=b.A;a.D=b.D;a.B=b.B;a.C=b.C};function d(b,d,c,e){var a;if(b._>=b.A){return false}a=b.E.charCodeAt(b._);if(a>e||a>>3]&1<<(a&7))===0){return false}b._++;return true};function e(a,d,c,e){var b;if(a._>=a.A){return false}b=a.E.charCodeAt(a._);if(b>e||b>>3]&1<<(b&7))===0){a._++;return true}return false};function p(a,d,c,e){var b;if(a._<=a.D){return false}b=a.E.charCodeAt(a._-1);if(b>e||b>>3]&1<<(b&7))===0){a._--;return true}return false};function m(a,b,d){var c;if(a.A-a._>>1);h=0;c=g0){break}if(d===b){break}if(l){break}l=true}}while(true){a=m[b];if(g>=a.F){f._=e+a.F|0;if(a.H==null){return a.I}o=a.H(a.P);f._=e+a.F|0;if(o){return a.I}}b=a.L;if(b<0){return 0}}return-1};function f(d,m,p){var b;var g;var e;var n;var f;var k;var l;var i;var h;var c;var a;var j;var o;b=0;g=p;e=d._;n=d.D;f=0;k=0;l=false;while(true){i=b+(g-b>>1);h=0;c=f=0;j--){if(e-c===n){h=-1;break}h=d.E.charCodeAt(e-1-c)-a.K.charCodeAt(j);if(h!==0){break}c++}if(h<0){g=i;k=c}else{b=i;f=c}if(g-b<=1){if(b>0){break}if(g===b){break}if(l){break}l=true}}while(true){a=m[b];if(f>=a.F){d._=e-a.F|0;if(a.H==null){return a.I}o=a.H(d);d._=e-a.F|0;if(o){return a.I}}b=a.L;if(b<0){return 0}}return-1};function s(a,b,d,e){var c;c=e.length-(d-b);a.E=a.E.slice(0,b)+e+a.E.slice(d);a.A+=c|0;if(a._>=d){a._+=c|0}else if(a._>b){a._=b}return c|0};function c(a,f){var b;var c;var d;var e;b=false;if((c=a.B)<0||c>(d=a.C)||d>(e=a.A)||e>a.E.length?false:true){s(a,a.B,a.C,f);b=true}return b};g.prototype.J=function(){return false};g.prototype.b=function(b){var a;var c;var d;var e;a=this.G['.'+b];if(a==null){c=this.E=b;d=this._=0;e=this.A=c.length;this.D=0;this.B=d;this.C=e;this.J();a=this.E;this.G['.'+b]=a}return a};g.prototype.stemWord=g.prototype.b;g.prototype.c=function(e){var d;var b;var c;var a;var f;var g;var h;d=[];for(b=0;b=this.A){break d}this._++}continue b}this._=i;break b}return true};b.prototype.r_prelude=b.prototype.W;function G(a){var j;var e;var k;var f;var g;var h;var i;var l;b:while(true){j=a._;f=true;d:while(f===true){f=false;e:while(true){e=a._;g=true;a:while(g===true){g=false;if(!d(a,b.g_v,97,259)){break a}a.B=a._;h=true;f:while(h===true){h=false;k=a._;i=true;c:while(i===true){i=false;if(!m(a,1,'u')){break c}a.C=a._;if(!d(a,b.g_v,97,259)){break c}if(!c(a,'U')){return false}break f}a._=k;if(!m(a,1,'i')){break a}a.C=a._;if(!d(a,b.g_v,97,259)){break a}if(!c(a,'I')){return false}}a._=e;break e}l=a._=e;if(l>=a.A){break d}a._++}continue b}a._=j;break b}return true};b.prototype.U=function(){var u;var w;var x;var y;var t;var l;var f;var g;var h;var i;var c;var j;var k;var a;var m;var n;var o;var p;var q;var r;var s;var v;this.I_pV=s=this.A;this.I_p1=s;this.I_p2=s;u=this._;l=true;a:while(l===true){l=false;f=true;g:while(f===true){f=false;w=this._;g=true;b:while(g===true){g=false;if(!d(this,b.g_v,97,259)){break b}h=true;f:while(h===true){h=false;x=this._;i=true;c:while(i===true){i=false;if(!e(this,b.g_v,97,259)){break c}d:while(true){c=true;e:while(c===true){c=false;if(!d(this,b.g_v,97,259)){break e}break d}if(this._>=this.A){break c}this._++}break f}this._=x;if(!d(this,b.g_v,97,259)){break b}c:while(true){j=true;d:while(j===true){j=false;if(!e(this,b.g_v,97,259)){break d}break c}if(this._>=this.A){break b}this._++}}break g}this._=w;if(!e(this,b.g_v,97,259)){break a}k=true;c:while(k===true){k=false;y=this._;a=true;b:while(a===true){a=false;if(!e(this,b.g_v,97,259)){break b}e:while(true){m=true;d:while(m===true){m=false;if(!d(this,b.g_v,97,259)){break d}break e}if(this._>=this.A){break b}this._++}break c}this._=y;if(!d(this,b.g_v,97,259)){break a}if(this._>=this.A){break a}this._++}}this.I_pV=this._}v=this._=u;t=v;n=true;a:while(n===true){n=false;b:while(true){o=true;c:while(o===true){o=false;if(!d(this,b.g_v,97,259)){break c}break b}if(this._>=this.A){break a}this._++}b:while(true){p=true;c:while(p===true){p=false;if(!e(this,b.g_v,97,259)){break c}break b}if(this._>=this.A){break a}this._++}this.I_p1=this._;b:while(true){q=true;c:while(q===true){q=false;if(!d(this,b.g_v,97,259)){break c}break b}if(this._>=this.A){break a}this._++}c:while(true){r=true;b:while(r===true){r=false;if(!e(this,b.g_v,97,259)){break b}break c}if(this._>=this.A){break a}this._++}this.I_p2=this._}this._=t;return true};b.prototype.r_mark_regions=b.prototype.U;function H(a){var x;var y;var z;var u;var v;var l;var f;var g;var h;var i;var j;var k;var c;var m;var n;var o;var p;var q;var r;var s;var t;var w;a.I_pV=t=a.A;a.I_p1=t;a.I_p2=t;x=a._;l=true;a:while(l===true){l=false;f=true;g:while(f===true){f=false;y=a._;g=true;b:while(g===true){g=false;if(!d(a,b.g_v,97,259)){break b}h=true;f:while(h===true){h=false;z=a._;i=true;c:while(i===true){i=false;if(!e(a,b.g_v,97,259)){break c}d:while(true){j=true;e:while(j===true){j=false;if(!d(a,b.g_v,97,259)){break e}break d}if(a._>=a.A){break c}a._++}break f}a._=z;if(!d(a,b.g_v,97,259)){break b}c:while(true){k=true;d:while(k===true){k=false;if(!e(a,b.g_v,97,259)){break d}break c}if(a._>=a.A){break b}a._++}}break g}a._=y;if(!e(a,b.g_v,97,259)){break a}c=true;c:while(c===true){c=false;u=a._;m=true;b:while(m===true){m=false;if(!e(a,b.g_v,97,259)){break b}e:while(true){n=true;d:while(n===true){n=false;if(!d(a,b.g_v,97,259)){break d}break e}if(a._>=a.A){break b}a._++}break c}a._=u;if(!d(a,b.g_v,97,259)){break a}if(a._>=a.A){break a}a._++}}a.I_pV=a._}w=a._=x;v=w;o=true;a:while(o===true){o=false;b:while(true){p=true;c:while(p===true){p=false;if(!d(a,b.g_v,97,259)){break c}break b}if(a._>=a.A){break a}a._++}b:while(true){q=true;c:while(q===true){q=false;if(!e(a,b.g_v,97,259)){break c}break b}if(a._>=a.A){break a}a._++}a.I_p1=a._;b:while(true){r=true;c:while(r===true){r=false;if(!d(a,b.g_v,97,259)){break c}break b}if(a._>=a.A){break a}a._++}c:while(true){s=true;b:while(s===true){s=false;if(!e(a,b.g_v,97,259)){break b}break c}if(a._>=a.A){break a}a._++}a.I_p2=a._}a._=v;return true};b.prototype.V=function(){var a;var e;var d;b:while(true){e=this._;d=true;a:while(d===true){d=false;this.B=this._;a=q(this,b.a_0,3);if(a===0){break a}this.C=this._;switch(a){case 0:break a;case 1:if(!c(this,'i')){return false}break;case 2:if(!c(this,'u')){return false}break;case 3:if(this._>=this.A){break a}this._++;break}continue b}this._=e;break b}return true};b.prototype.r_postlude=b.prototype.V;function I(a){var d;var f;var e;b:while(true){f=a._;e=true;a:while(e===true){e=false;a.B=a._;d=q(a,b.a_0,3);if(d===0){break a}a.C=a._;switch(d){case 0:break a;case 1:if(!c(a,'i')){return false}break;case 2:if(!c(a,'u')){return false}break;case 3:if(a._>=a.A){break a}a._++;break}continue b}a._=f;break b}return true};b.prototype.S=function(){return!(this.I_pV<=this._)?false:true};b.prototype.r_RV=b.prototype.S;b.prototype.Q=function(){return!(this.I_p1<=this._)?false:true};b.prototype.r_R1=b.prototype.Q;b.prototype.R=function(){return!(this.I_p2<=this._)?false:true};b.prototype.r_R2=b.prototype.R;b.prototype.Y=function(){var a;var e;var d;var g;this.C=this._;a=f(this,b.a_1,16);if(a===0){return false}this.B=g=this._;if(!(!(this.I_p1<=g)?false:true)){return false}switch(a){case 0:return false;case 1:if(!c(this,'')){return false}break;case 2:if(!c(this,'a')){return false}break;case 3:if(!c(this,'e')){return false}break;case 4:if(!c(this,'i')){return false}break;case 5:e=this.A-this._;d=true;a:while(d===true){d=false;if(!i(this,2,'ab')){break a}return false}this._=this.A-e;if(!c(this,'i')){return false}break;case 6:if(!c(this,'at')){return false}break;case 7:if(!c(this,'aţi')){return false}break}return true};b.prototype.r_step_0=b.prototype.Y;function J(a){var d;var g;var e;var h;a.C=a._;d=f(a,b.a_1,16);if(d===0){return false}a.B=h=a._;if(!(!(a.I_p1<=h)?false:true)){return false}switch(d){case 0:return false;case 1:if(!c(a,'')){return false}break;case 2:if(!c(a,'a')){return false}break;case 3:if(!c(a,'e')){return false}break;case 4:if(!c(a,'i')){return false}break;case 5:g=a.A-a._;e=true;a:while(e===true){e=false;if(!i(a,2,'ab')){break a}return false}a._=a.A-g;if(!c(a,'i')){return false}break;case 6:if(!c(a,'at')){return false}break;case 7:if(!c(a,'aţi')){return false}break}return true};b.prototype.T=function(){var a;var d;var e;var g;d=this.A-(e=this._);this.C=e;a=f(this,b.a_2,46);if(a===0){return false}this.B=g=this._;if(!(!(this.I_p1<=g)?false:true)){return false}switch(a){case 0:return false;case 1:if(!c(this,'abil')){return false}break;case 2:if(!c(this,'ibil')){return false}break;case 3:if(!c(this,'iv')){return false}break;case 4:if(!c(this,'ic')){return false}break;case 5:if(!c(this,'at')){return false}break;case 6:if(!c(this,'it')){return false}break}this.B_standard_suffix_removed=true;this._=this.A-d;return true};b.prototype.r_combo_suffix=b.prototype.T;function o(a){var d;var e;var g;var h;e=a.A-(g=a._);a.C=g;d=f(a,b.a_2,46);if(d===0){return false}a.B=h=a._;if(!(!(a.I_p1<=h)?false:true)){return false}switch(d){case 0:return false;case 1:if(!c(a,'abil')){return false}break;case 2:if(!c(a,'ibil')){return false}break;case 3:if(!c(a,'iv')){return false}break;case 4:if(!c(a,'ic')){return false}break;case 5:if(!c(a,'at')){return false}break;case 6:if(!c(a,'it')){return false}break}a.B_standard_suffix_removed=true;a._=a.A-e;return true};b.prototype.X=function(){var a;var e;var d;var g;this.B_standard_suffix_removed=false;a:while(true){e=this.A-this._;d=true;b:while(d===true){d=false;if(!o(this)){break b}continue a}this._=this.A-e;break a}this.C=this._;a=f(this,b.a_3,62);if(a===0){return false}this.B=g=this._;if(!(!(this.I_p2<=g)?false:true)){return false}switch(a){case 0:return false;case 1:if(!c(this,'')){return false}break;case 2:if(!i(this,1,'ţ')){return false}this.B=this._;if(!c(this,'t')){return false}break;case 3:if(!c(this,'ist')){return false}break}this.B_standard_suffix_removed=true;return true};b.prototype.r_standard_suffix=b.prototype.X;function K(a){var d;var g;var e;var h;a.B_standard_suffix_removed=false;a:while(true){g=a.A-a._;e=true;b:while(e===true){e=false;if(!o(a)){break b}continue a}a._=a.A-g;break a}a.C=a._;d=f(a,b.a_3,62);if(d===0){return false}a.B=h=a._;if(!(!(a.I_p2<=h)?false:true)){return false}switch(d){case 0:return false;case 1:if(!c(a,'')){return false}break;case 2:if(!i(a,1,'ţ')){return false}a.B=a._;if(!c(a,'t')){return false}break;case 3:if(!c(a,'ist')){return false}break}a.B_standard_suffix_removed=true;return true};b.prototype.Z=function(){var d;var h;var a;var j;var e;var g;var k;var l;var m;h=this.A-(k=this._);if(k=b.A){return false}a=b.E.charCodeAt(b._);if(a>e||a>>3]&1<<(a&7))===0){return false}b._++;return true};function f(b,d,c,e){var a;if(b._<=b.D){return false}a=b.E.charCodeAt(b._-1);if(a>e||a>>3]&1<<(a&7))===0){return false}b._--;return true};function t(a,d,c,e){var b;if(a._<=a.D){return false}b=a.E.charCodeAt(a._-1);if(b>e||b>>3]&1<<(b&7))===0){a._--;return true}return false};function s(a,b,d){var c;if(a.A-a._>1);h=0;c=f=0;j--){if(e-c===n){h=-1;break}h=d.E.charCodeAt(e-1-c)-a.A_.charCodeAt(j);if(h!==0){break}c++}if(h<0){g=i;k=c}else{b=i;f=c}if(g-b<=1){if(b>0){break}if(g===b){break}if(l){break}l=true}}while(true){a=m[b];if(f>=a.G){d._=e-a.G|0;if(a.I==null){return a.J}o=a.I(d);d._=e-a.G|0;if(o){return a.J}}b=a.D_;if(b<0){return 0}}return-1};function n(a,b,d,e){var c;c=e.length-(d-b);a.E=a.E.slice(0,b)+e+a.E.slice(d);a.A+=c|0;if(a._>=d){a._+=c|0}else if(a._>b){a._=b}return c|0};function e(a,f){var b;var c;var d;var e;b=false;if((c=a.B)<0||c>(d=a.C)||d>(e=a.A)||e>a.E.length?false:true){n(a,a.B,a.C,f);b=true}return b};m.prototype.H=function(){return false};m.prototype.B_=function(b){var a;var c;var d;var e;a=this.F['.'+b];if(a==null){c=this.E=b;d=this._=0;e=this.A=c.length;this.D=0;this.B=d;this.C=e;this.H();a=this.E;this.F['.'+b]=a}return a};m.prototype.stemWord=m.prototype.B_;m.prototype.C_=function(e){var d;var b;var c;var a;var f;var g;var h;d=[];for(b=0;b=this.A){break b}this._++}b--;continue a}this._=f;break a}if(b>0){return false}this._=e;return true};a.prototype.r_more_than_one_syllable_word=a.prototype.v;function N(b){var f;var g;var c;var d;var e;f=b._;c=2;a:while(true){g=b._;d=true;b:while(d===true){d=false;c:while(true){e=true;d:while(e===true){e=false;if(!v(b,a.g_vowel,97,305)){break d}break c}if(b._>=b.A){break b}b._++}c--;continue a}b._=g;break a}if(c>0){return false}b._=f;return true};a.prototype.P=function(){var f;var g;var h;var b;var a;var c;var d;var i;var j;var e;b=true;b:while(b===true){b=false;f=this._;a=true;a:while(a===true){a=false;g=this._;c:while(true){c=true;d:while(c===true){c=false;if(!s(this,2,'ad')){break d}break c}if(this._>=this.A){break a}this._++}i=this.I_strlen=2;if(!(i===this.A)){break a}this._=g;break b}j=this._=f;h=j;a:while(true){d=true;c:while(d===true){d=false;if(!s(this,5,'soyad')){break c}break a}if(this._>=this.A){return false}this._++}e=this.I_strlen=5;if(!(e===this.A)){return false}this._=h}return true};a.prototype.r_is_reserved_word=a.prototype.P;function x(a){var g;var h;var i;var c;var b;var d;var e;var j;var k;var f;c=true;b:while(c===true){c=false;g=a._;b=true;a:while(b===true){b=false;h=a._;c:while(true){d=true;d:while(d===true){d=false;if(!s(a,2,'ad')){break d}break c}if(a._>=a.A){break a}a._++}j=a.I_strlen=2;if(!(j===a.A)){break a}a._=h;break b}k=a._=g;i=k;a:while(true){e=true;c:while(e===true){e=false;if(!s(a,5,'soyad')){break c}break a}if(a._>=a.A){return false}a._++}f=a.I_strlen=5;if(!(f===a.A)){return false}a._=i}return true};a.prototype.x=function(){var d;var e;var a;var b;var c;var f;var g;var h;d=this._;a=true;a:while(a===true){a=false;if(!x(this)){break a}return false}f=this._=d;this.D=f;h=this._=g=this.A;e=g-h;b=true;a:while(b===true){b=false;if(!z(this)){break a}}this._=this.A-e;c=true;a:while(c===true){c=false;if(!w(this)){break a}}this._=this.D;return true};a.prototype.r_postlude=a.prototype.x;function O(a){var e;var f;var b;var c;var d;var g;var h;var i;e=a._;b=true;a:while(b===true){b=false;if(!x(a)){break a}return false}g=a._=e;a.D=g;i=a._=h=a.A;f=h-i;c=true;a:while(c===true){c=false;if(!z(a)){break a}}a._=a.A-f;d=true;a:while(d===true){d=false;if(!w(a)){break a}}a._=a.D;return true};a.prototype.H=function(){var c;var a;var b;var d;var e;if(!N(this)){return false}this.D=this._;e=this._=d=this.A;c=d-e;a=true;a:while(a===true){a=false;if(!J(this)){break a}}this._=this.A-c;if(!this.B_continue_stemming_noun_suffixes){return false}b=true;a:while(b===true){b=false;if(!L(this)){break a}}this._=this.D;return!O(this)?false:true};a.prototype.stem=a.prototype.H;a.prototype.L=function(b){return b instanceof a};a.prototype.equals=a.prototype.L;a.prototype.M=function(){var c;var a;var b;var d;c='TurkishStemmer';a=0;for(b=0;b