Define a common Inventory type for reuse across modules

This commit is contained in:
Jon Dufresne
2018-12-16 10:58:46 -08:00
parent 30ec4b6bba
commit e72391d995
3 changed files with 4 additions and 7 deletions

View File

@@ -33,7 +33,6 @@ from urllib.parse import urlsplit, urlunsplit
from docutils import nodes
from docutils.utils import relative_path
from six import text_type
import sphinx
from sphinx.builders.html import INVENTORY_FILENAME
@@ -47,8 +46,7 @@ if False:
from sphinx.application import Sphinx # NOQA
from sphinx.config import Config # NOQA
from sphinx.environment import BuildEnvironment # NOQA
Inventory = Dict[text_type, Dict[text_type, Tuple[text_type, text_type, text_type, text_type]]] # NOQA
from sphinx.util.typing import Inventory # NOQA
logger = logging.getLogger(__name__)

View File

@@ -12,8 +12,6 @@ import os
import re
import zlib
from six import text_type
from sphinx.util import logging
if False:
@@ -21,8 +19,7 @@ if False:
from typing import Callable, Dict, IO, Iterator, Tuple # NOQA
from sphinx.builders import Builder # NOQA
from sphinx.environment import BuildEnvironment # NOQA
Inventory = Dict[text_type, Dict[text_type, Tuple[text_type, text_type, text_type, text_type]]] # NOQA
from sphinx.util.typing import Inventory # NOQA
BUFSIZE = 16 * 1024

View File

@@ -28,3 +28,5 @@ RoleFunction = Callable[[text_type, text_type, text_type, int, Inliner, Dict, Li
# title getter functions for enumerable nodes (see sphinx.domains.std)
TitleGetter = Callable[[nodes.Node], text_type]
Inventory = Dict[str, Dict[str, Tuple[str, str, str, str]]]