Skip to content

Commit a5ddc3a

Browse files
committed
Add docstrings for Download object
1 parent 609d363 commit a5ddc3a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/textual_serve/download_manager.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,30 @@
1717
@dataclass
1818
class Download:
1919
app_service: "AppService"
20+
"""The app service that the download is associated with."""
21+
2022
delivery_key: str
23+
"""Key which identifies the download."""
24+
2125
file_name: str
26+
"""The name of the file to download. This will be used to set
27+
the Content-Disposition filename."""
28+
2229
open_method: str
30+
"""The method to open the file with. "browser" or "download"."""
31+
2332
mime_type: str
33+
"""The mime type of the content."""
34+
2435
encoding: str | None = None
2536
"""The encoding of the content.
2637
Will be None if the content is binary.
2738
"""
39+
2840
incoming_chunks: asyncio.Queue[bytes | None] = field(default_factory=asyncio.Queue)
41+
"""A queue of incoming chunks for the download.
42+
Chunks are sent from the app service to the download handler
43+
via this queue."""
2944

3045

3146
class DownloadManager:
@@ -80,7 +95,6 @@ async def download(self, delivery_key: str) -> AsyncGenerator[bytes, None]:
8095
"""Download a file from the given app service.
8196
8297
Args:
83-
app_service: The app service to download from.
8498
delivery_key: The delivery key to download.
8599
"""
86100

0 commit comments

Comments
 (0)