Skip to content

Commit dd80f67

Browse files
committed
fix: pong response & chunked upload
1 parent 362ea5a commit dd80f67

File tree

267 files changed

+280
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+280
-18
lines changed

β€ŽLICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

β€Žappwrite/client.py

+13-15
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ def __init__(self):
1313
self._endpoint = 'https://cloud.appwrite.io/v1'
1414
self._global_headers = {
1515
'content-type': '',
16-
'user-agent' : 'AppwritePythonSDK/6.2.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
16+
'user-agent' : 'AppwritePythonSDK/7.1.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
1717
'x-sdk-name': 'Python',
1818
'x-sdk-platform': 'server',
1919
'x-sdk-language': 'python',
20-
'x-sdk-version': '6.2.0',
20+
'x-sdk-version': '7.1.1',
2121
'X-Appwrite-Response-Format' : '1.6.0',
2222
}
2323

@@ -79,7 +79,7 @@ def call(self, method, path='', headers=None, params=None, response_type='json')
7979
data = {}
8080
files = {}
8181
stringify = False
82-
82+
8383
headers = {**self._global_headers, **headers}
8484

8585
if method != 'get':
@@ -170,12 +170,11 @@ def chunked_upload(
170170
offset = 0
171171
counter = 0
172172

173-
if upload_id != 'unique()':
174-
try:
175-
result = self.call('get', path + '/' + upload_id, headers)
176-
counter = result['chunksUploaded']
177-
except:
178-
pass
173+
try:
174+
result = self.call('get', path + '/' + upload_id, headers)
175+
counter = result['chunksUploaded']
176+
except:
177+
pass
179178

180179
if counter > 0:
181180
offset = counter * self._chunk_size
@@ -188,7 +187,7 @@ def chunked_upload(
188187
if offset + self._chunk_size < size:
189188
end = offset + self._chunk_size
190189
else:
191-
end = size - offset
190+
end = size
192191
input_file.data = input[offset:end]
193192

194193
params[param_name] = input_file
@@ -200,10 +199,10 @@ def chunked_upload(
200199
headers,
201200
params,
202201
)
203-
202+
204203
offset = offset + self._chunk_size
205-
206-
if "$id" in result:
204+
205+
if "$id" in result:
207206
headers["x-appwrite-id"] = result["$id"]
208207

209208
if on_progress is not None:
@@ -229,7 +228,7 @@ def flatten(self, data, prefix='', stringify=False):
229228
finalKey = prefix + '[' + key +']' if prefix else key
230229
finalKey = prefix + '[' + str(i) +']' if isinstance(data, list) else finalKey
231230
i += 1
232-
231+
233232
if isinstance(value, list) or isinstance(value, dict):
234233
output = {**output, **self.flatten(value, finalKey, stringify)}
235234
else:
@@ -239,4 +238,3 @@ def flatten(self, data, prefix='', stringify=False):
239238
output[finalKey] = value
240239

241240
return output
242-

β€Žappwrite/enums/image_format.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ class ImageFormat(Enum):
66
GIF = "gif"
77
PNG = "png"
88
WEBP = "webp"
9+
HEIC = "heic"
910
AVIF = "avif"

β€Ždocs/examples/account/create-anonymous-session.md

+1

β€Ždocs/examples/account/create-email-password-session.md

+1

β€Ždocs/examples/account/create-email-token.md

+1

β€Ždocs/examples/account/create-j-w-t.md

+1

β€Ždocs/examples/account/create-magic-u-r-l-token.md

+1

β€Ždocs/examples/account/create-mfa-authenticator.md

+1

β€Ždocs/examples/account/create-mfa-challenge.md

+1

β€Ždocs/examples/account/create-mfa-recovery-codes.md

+1

β€Ždocs/examples/account/create-o-auth2token.md

+1

β€Ždocs/examples/account/create-phone-token.md

+1

β€Ždocs/examples/account/create-phone-verification.md

+1

β€Ždocs/examples/account/create-recovery.md

+1

β€Ždocs/examples/account/create-session.md

+1

β€Ždocs/examples/account/create-verification.md

+1

β€Ždocs/examples/account/create.md

+1

β€Ždocs/examples/account/delete-identity.md

+1

β€Ždocs/examples/account/delete-mfa-authenticator.md

+1

β€Ždocs/examples/account/delete-session.md

+1

β€Ždocs/examples/account/delete-sessions.md

+1

β€Ždocs/examples/account/get-mfa-recovery-codes.md

+1

β€Ždocs/examples/account/get-prefs.md

+1

β€Ždocs/examples/account/get-session.md

+1

β€Ždocs/examples/account/get.md

+1

β€Ždocs/examples/account/list-identities.md

+1

β€Ždocs/examples/account/list-logs.md

+1

β€Ždocs/examples/account/list-mfa-factors.md

+1

β€Ždocs/examples/account/list-sessions.md

+1

β€Ždocs/examples/account/update-email.md

+1

β€Ždocs/examples/account/update-m-f-a.md

+1

β€Ždocs/examples/account/update-magic-u-r-l-session.md

+1

β€Ždocs/examples/account/update-mfa-authenticator.md

+1

β€Ždocs/examples/account/update-mfa-challenge.md

+1

β€Ždocs/examples/account/update-mfa-recovery-codes.md

+1

β€Ždocs/examples/account/update-name.md

+1

β€Ždocs/examples/account/update-password.md

+1

β€Ždocs/examples/account/update-phone-session.md

+1

β€Ždocs/examples/account/update-phone-verification.md

+1

β€Ždocs/examples/account/update-phone.md

+1

β€Ždocs/examples/account/update-prefs.md

+1

β€Ždocs/examples/account/update-recovery.md

+1

β€Ždocs/examples/account/update-session.md

+1

β€Ždocs/examples/account/update-status.md

+1

β€Ždocs/examples/account/update-verification.md

+1

β€Ždocs/examples/avatars/get-browser.md

+1

β€Ždocs/examples/avatars/get-credit-card.md

+1

β€Ždocs/examples/avatars/get-favicon.md

+1

β€Ždocs/examples/avatars/get-flag.md

+1

β€Ždocs/examples/avatars/get-image.md

+1

β€Ždocs/examples/avatars/get-initials.md

+1

β€Ždocs/examples/avatars/get-q-r.md

+1

β€Ždocs/examples/databases/create-boolean-attribute.md

+1

0 commit comments

Comments
Β (0)