mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
Chore: Drop Python 3.9 support (#7774)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import abc
|
||||
from pathlib import Path
|
||||
from typing import Final
|
||||
from typing import Optional
|
||||
|
||||
from documents.data_models import ConsumableDocument
|
||||
from documents.data_models import DocumentMetadataOverrides
|
||||
@@ -88,7 +87,7 @@ class ConsumeTaskPlugin(abc.ABC):
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def run(self) -> Optional[str]:
|
||||
def run(self) -> str | None:
|
||||
"""
|
||||
The bulk of plugin processing, this does whatever action the plugin is for.
|
||||
|
||||
|
@@ -1,7 +1,5 @@
|
||||
import enum
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Optional
|
||||
from typing import Union
|
||||
|
||||
from asgiref.sync import async_to_sync
|
||||
from channels.layers import get_channel_layer
|
||||
@@ -23,9 +21,9 @@ class ProgressManager:
|
||||
of the open/close of the layer to ensure messages go out and everything is cleaned up
|
||||
"""
|
||||
|
||||
def __init__(self, filename: str, task_id: Optional[str] = None) -> None:
|
||||
def __init__(self, filename: str, task_id: str | None = None) -> None:
|
||||
self.filename = filename
|
||||
self._channel: Optional[RedisPubSubChannelLayer] = None
|
||||
self._channel: RedisPubSubChannelLayer | None = None
|
||||
self.task_id = task_id
|
||||
|
||||
def __enter__(self):
|
||||
@@ -57,7 +55,7 @@ class ProgressManager:
|
||||
message: str,
|
||||
current_progress: int,
|
||||
max_progress: int,
|
||||
extra_args: Optional[dict[str, Union[str, int, None]]] = None,
|
||||
extra_args: dict[str, str | int | None] | None = None,
|
||||
) -> None:
|
||||
# Ensure the layer is open
|
||||
self.open()
|
||||
|
Reference in New Issue
Block a user