mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-02-03 23:22:42 -06:00
Chore(mypy): Annotate None returns for typing improvements (#11213)
This commit is contained in:
committed by
GitHub
parent
a9c0b06e28
commit
3b5ffbf9fa
@@ -340,7 +340,7 @@ class DocumentParser(LoggingMixin):
|
||||
|
||||
logging_name = "paperless.parsing"
|
||||
|
||||
def __init__(self, logging_group, progress_callback=None):
|
||||
def __init__(self, logging_group, progress_callback=None) -> None:
|
||||
super().__init__()
|
||||
self.renew_logging_group()
|
||||
self.logging_group = logging_group
|
||||
@@ -355,7 +355,7 @@ class DocumentParser(LoggingMixin):
|
||||
self.date: datetime.datetime | None = None
|
||||
self.progress_callback = progress_callback
|
||||
|
||||
def progress(self, current_progress, max_progress):
|
||||
def progress(self, current_progress, max_progress) -> None:
|
||||
if self.progress_callback:
|
||||
self.progress_callback(current_progress, max_progress)
|
||||
|
||||
@@ -380,7 +380,7 @@ class DocumentParser(LoggingMixin):
|
||||
def extract_metadata(self, document_path, mime_type):
|
||||
return []
|
||||
|
||||
def get_page_count(self, document_path, mime_type):
|
||||
def get_page_count(self, document_path, mime_type) -> None:
|
||||
return None
|
||||
|
||||
def parse(self, document_path, mime_type, file_name=None):
|
||||
@@ -401,6 +401,6 @@ class DocumentParser(LoggingMixin):
|
||||
def get_date(self) -> datetime.datetime | None:
|
||||
return self.date
|
||||
|
||||
def cleanup(self):
|
||||
def cleanup(self) -> None:
|
||||
self.log.debug(f"Deleting directory {self.tempdir}")
|
||||
shutil.rmtree(self.tempdir)
|
||||
|
||||
Reference in New Issue
Block a user