Skip to content

Commit

Permalink
add str repr
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Oct 30, 2024
1 parent 59ea8ee commit 0e10acf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/codeboxapi/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ async def asave(self, local_path: str) -> None:
async for chunk in self.remote.astream_download(self.path):
await f.write(chunk)

def __str__(self) -> str:
return self.name

def __repr__(self) -> str:
if self._size is None:
return f"RemoteFile({self.path})"
return f"RemoteFile({self.path}, {self._size} bytes)"


@dataclass
class ExecChunk:
Expand Down

0 comments on commit 0e10acf

Please sign in to comment.