Skip to content

Commit d59daaf

Browse files
added "create_file" method to square.Application
1 parent 274aa61 commit d59daaf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

squarecloud/app.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ async def commit(self, file: File,
286286
return response
287287

288288
async def files_list(self, path: str, **kwargs):
289-
response: list[FileInfo] = await self.client.app_files_list(self.id, path)
289+
response: list[FileInfo] = await self.client.app_files_list(self.id,
290+
path)
290291

291292
if not kwargs.get('avoid_listener'):
292293
endpoint: Endpoint = Endpoint.files_list()
@@ -301,3 +302,11 @@ async def read_file(self, path: str, **kwargs):
301302
await self._listener.on_capture(endpoint=endpoint,
302303
response=response)
303304
return response
305+
306+
async def create_file(self, path: str, **kwargs):
307+
response: None = await self.client.read_app_file(self.id, path)
308+
if not kwargs.get('avoid_listener'):
309+
endpoint: Endpoint = Endpoint.files_read()
310+
await self._listener.on_capture(endpoint=endpoint,
311+
response=response)
312+
return response

0 commit comments

Comments
 (0)