Add type hint, resolving circular import.
This commit is contained in:
parent
1ce769e70d
commit
1eb8b927c2
1 changed files with 6 additions and 2 deletions
|
|
@ -3,12 +3,16 @@ import zipfile
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from typing import BinaryIO, Any
|
from typing import BinaryIO, Any, TYPE_CHECKING
|
||||||
|
|
||||||
from .._base_converter import DocumentConverter, DocumentConverterResult
|
from .._base_converter import DocumentConverter, DocumentConverterResult
|
||||||
from .._stream_info import StreamInfo
|
from .._stream_info import StreamInfo
|
||||||
from .._exceptions import UnsupportedFormatException, FileConversionException
|
from .._exceptions import UnsupportedFormatException, FileConversionException
|
||||||
|
|
||||||
|
# Break otherwise circular import for type hinting
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from .._markitdown import MarkItDown
|
||||||
|
|
||||||
ACCEPTED_MIME_TYPE_PREFIXES = [
|
ACCEPTED_MIME_TYPE_PREFIXES = [
|
||||||
"application/zip",
|
"application/zip",
|
||||||
]
|
]
|
||||||
|
|
@ -59,7 +63,7 @@ class ZipConverter(DocumentConverter):
|
||||||
self,
|
self,
|
||||||
priority: float = DocumentConverter.PRIORITY_SPECIFIC_FILE_FORMAT,
|
priority: float = DocumentConverter.PRIORITY_SPECIFIC_FILE_FORMAT,
|
||||||
*,
|
*,
|
||||||
markitdown: Any,
|
markitdown: "MarkItDown",
|
||||||
):
|
):
|
||||||
super().__init__(priority=priority)
|
super().__init__(priority=priority)
|
||||||
self._markitdown = markitdown
|
self._markitdown = markitdown
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue