dav_file dataclass

This commit is contained in:
Jörn-Michael Miehe 2022-09-04 14:14:22 +00:00
parent cf684ee5f9
commit 9b969b6024

View file

@ -1,5 +1,6 @@
import logging
import time
from dataclasses import dataclass
from io import BytesIO
from typing import Any, Optional
@ -38,14 +39,14 @@ async def _get_buffer(
return await buffer_inner(resource)
@dataclass(frozen=True)
class DavFile:
def __init__(self, remote_path: Any) -> None:
self.__remote_path = remote_path
remote_path: str
@property
async def __buffer(self) -> BytesIO:
return await _get_buffer(
remote_path=self.__remote_path,
remote_path=self.remote_path,
ttl_hash=_get_ttl_hash(20),
)