mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-02-11 23:59:31 -06:00
Chore(mypy): Annotate None returns for typing improvements (#11213)
This commit is contained in:
committed by
GitHub
parent
a9c0b06e28
commit
3b5ffbf9fa
@@ -7,7 +7,7 @@ from paperless_tika.signals import tika_consumer_declaration
|
||||
class PaperlessTikaConfig(AppConfig):
|
||||
name = "paperless_tika"
|
||||
|
||||
def ready(self):
|
||||
def ready(self) -> None:
|
||||
from documents.signals import document_consumer_declaration
|
||||
|
||||
if settings.TIKA_ENABLED:
|
||||
|
||||
@@ -53,7 +53,7 @@ class TikaDocumentParser(DocumentParser):
|
||||
)
|
||||
return []
|
||||
|
||||
def parse(self, document_path: Path, mime_type: str, file_name=None):
|
||||
def parse(self, document_path: Path, mime_type: str, file_name=None) -> None:
|
||||
self.log.info(f"Sending {document_path} to Tika server")
|
||||
|
||||
try:
|
||||
|
||||
@@ -26,7 +26,7 @@ class TestTikaParserAgainstServer:
|
||||
self,
|
||||
tika_parser: TikaDocumentParser,
|
||||
sample_odt_file: Path,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An input ODT format document
|
||||
@@ -55,7 +55,7 @@ class TestTikaParserAgainstServer:
|
||||
self,
|
||||
tika_parser: TikaDocumentParser,
|
||||
sample_docx_file: Path,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An input DOCX format document
|
||||
@@ -87,7 +87,7 @@ class TestTikaParserAgainstServer:
|
||||
self,
|
||||
tika_parser: TikaDocumentParser,
|
||||
sample_doc_file: Path,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An input DOC format document
|
||||
@@ -114,7 +114,7 @@ class TestTikaParserAgainstServer:
|
||||
self,
|
||||
tika_parser: TikaDocumentParser,
|
||||
sample_broken_odt: Path,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An input ODT format document
|
||||
|
||||
@@ -20,7 +20,7 @@ class TestTikaParser:
|
||||
settings: SettingsWrapper,
|
||||
tika_parser: TikaDocumentParser,
|
||||
sample_odt_file: Path,
|
||||
):
|
||||
) -> None:
|
||||
settings.TIME_ZONE = "America/Chicago"
|
||||
# Pretend parse response
|
||||
httpx_mock.add_response(
|
||||
@@ -53,7 +53,7 @@ class TestTikaParser:
|
||||
httpx_mock: HTTPXMock,
|
||||
tika_parser: TikaDocumentParser,
|
||||
sample_odt_file: Path,
|
||||
):
|
||||
) -> None:
|
||||
httpx_mock.add_response(
|
||||
json={
|
||||
"Content-Type": "application/vnd.oasis.opendocument.text",
|
||||
@@ -76,7 +76,7 @@ class TestTikaParser:
|
||||
httpx_mock: HTTPXMock,
|
||||
tika_parser: TikaDocumentParser,
|
||||
sample_odt_file: Path,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Document needs to be converted to PDF
|
||||
@@ -108,7 +108,7 @@ class TestTikaParser:
|
||||
settings: SettingsWrapper,
|
||||
tika_parser: TikaDocumentParser,
|
||||
sample_odt_file: Path,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Document needs to be converted to PDF
|
||||
|
||||
Reference in New Issue
Block a user