Skip to content

Commit 67252b2

Browse files
added "read_file" method to square.Application
1 parent 2f8e0cd commit 67252b2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

squarecloud/app.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,3 +292,11 @@ async def files_list(self, path: str, **kwargs):
292292
await self._listener.on_capture(endpoint=endpoint,
293293
response=response)
294294
return response
295+
296+
async def read_file(self, path: str, **kwargs):
297+
response: Response = await self.client.read_app_file(self.id, path)
298+
if not kwargs.get('avoid_listener'):
299+
endpoint: Endpoint = Endpoint.files_read()
300+
await self._listener.on_capture(endpoint=endpoint,
301+
response=response)
302+
return response

0 commit comments

Comments
 (0)