mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 04:42:15 -04:00
Use auto_attribs/native type hints for attrs classes. (#11692)
This commit is contained in:
parent
b92a2ff797
commit
10a88ba91c
40 changed files with 300 additions and 307 deletions
|
@ -343,7 +343,7 @@ class SpamMediaException(NotFoundError):
|
|||
"""
|
||||
|
||||
|
||||
@attr.s(slots=True)
|
||||
@attr.s(slots=True, auto_attribs=True)
|
||||
class ReadableFileWrapper:
|
||||
"""Wrapper that allows reading a file in chunks, yielding to the reactor,
|
||||
and writing to a callback.
|
||||
|
@ -354,8 +354,8 @@ class ReadableFileWrapper:
|
|||
|
||||
CHUNK_SIZE = 2 ** 14
|
||||
|
||||
clock = attr.ib(type=Clock)
|
||||
path = attr.ib(type=str)
|
||||
clock: Clock
|
||||
path: str
|
||||
|
||||
async def write_chunks_to(self, callback: Callable[[bytes], None]) -> None:
|
||||
"""Reads the file in chunks and calls the callback with each chunk."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue