Skip to content

Commit 0e10acf

Browse files
committed
add str repr
1 parent 59ea8ee commit 0e10acf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/codeboxapi/types.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ async def asave(self, local_path: str) -> None:
4949
async for chunk in self.remote.astream_download(self.path):
5050
await f.write(chunk)
5151

52+
def __str__(self) -> str:
53+
return self.name
54+
55+
def __repr__(self) -> str:
56+
if self._size is None:
57+
return f"RemoteFile({self.path})"
58+
return f"RemoteFile({self.path}, {self._size} bytes)"
59+
5260

5361
@dataclass
5462
class ExecChunk:

0 commit comments

Comments
 (0)