diff --git a/radicale/storage/multifilesystem/__init__.py b/radicale/storage/multifilesystem/__init__.py index b5b24b1..67aa6a5 100644 --- a/radicale/storage/multifilesystem/__init__.py +++ b/radicale/storage/multifilesystem/__init__.py @@ -25,7 +25,7 @@ Uses one folder per collection and one file per collection entry. import os import time -from typing import Iterator, Optional +from typing import ClassVar, Iterator, Optional, Type from radicale import config from radicale.storage.multifilesystem.base import CollectionBase, StorageBase @@ -84,7 +84,7 @@ class Storage( StoragePartCreateCollection, StoragePartLock, StoragePartMove, StoragePartVerify, StoragePartDiscover, StorageBase): - _collection_class = Collection + _collection_class: ClassVar[Type[Collection]] = Collection def __init__(self, configuration: config.Configuration) -> None: super().__init__(configuration) diff --git a/radicale/storage/multifilesystem/base.py b/radicale/storage/multifilesystem/base.py index 241458c..4b1fb5d 100644 --- a/radicale/storage/multifilesystem/base.py +++ b/radicale/storage/multifilesystem/base.py @@ -18,7 +18,7 @@ import os from tempfile import TemporaryDirectory -from typing import IO, AnyStr, Iterator, Optional, Type +from typing import IO, AnyStr, ClassVar, Iterator, Optional, Type from radicale import config, pathutils, storage, types from radicale.storage import multifilesystem # noqa:F401 @@ -62,7 +62,8 @@ class CollectionBase(storage.BaseCollection): class StorageBase(storage.BaseStorage): - _collection_class: Type["multifilesystem.Collection"] + _collection_class: ClassVar[Type["multifilesystem.Collection"]] + _filesystem_folder: str _filesystem_fsync: bool diff --git a/radicale/storage/multifilesystem_nolock.py b/radicale/storage/multifilesystem_nolock.py index 0ca087d..3653de8 100644 --- a/radicale/storage/multifilesystem_nolock.py +++ b/radicale/storage/multifilesystem_nolock.py @@ -20,7 +20,7 @@ The multifilesystem backend without file-based locking. import threading from collections import deque -from typing import Deque, Dict, Hashable, Iterator +from typing import ClassVar, Deque, Dict, Hashable, Iterator, Type from radicale import config, pathutils, types from radicale.storage import multifilesystem @@ -103,7 +103,7 @@ class Collection(multifilesystem.Collection): class Storage(multifilesystem.Storage): - _collection_class = Collection + _collection_class: ClassVar[Type[Collection]] = Collection _cache_lock: LockDict