Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33e173b

Browse files
authored
Merge pull request#102 from appwrite/dev
fix: pong response & chunked upload
2 parents6ca2104 +3f190c8 commit33e173b

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

‎appwrite/client.py

Lines changed: 13 additions & 15 deletions
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/7.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
16+
'user-agent' :'AppwritePythonSDK/8.0.0 (${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':'7.1.0',
20+
'x-sdk-version':'8.0.0',
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
ifmethod!='get':
@@ -170,12 +170,11 @@ def chunked_upload(
170170
offset=0
171171
counter=0
172172

173-
ifupload_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
ifcounter>0:
181180
offset=counter*self._chunk_size
@@ -188,7 +187,7 @@ def chunked_upload(
188187
ifoffset+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"inresult:
204+
205+
if"$id"inresult:
207206
headers["x-appwrite-id"]=result["$id"]
208207

209208
ifon_progressisnotNone:
@@ -229,7 +228,7 @@ def flatten(self, data, prefix='', stringify=False):
229228
finalKey=prefix+'['+key+']'ifprefixelsekey
230229
finalKey=prefix+'['+str(i)+']'ifisinstance(data,list)elsefinalKey
231230
i+=1
232-
231+
233232
ifisinstance(value,list)orisinstance(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
returnoutput
242-

‎appwrite/enums/image_format.py

Lines changed: 1 addition & 0 deletions
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"

‎setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'appwrite/encoders',
1414
'appwrite/enums',
1515
],
16-
version='7.1.0',
16+
version='8.0.0'
1717
license='BSD-3-Clause',
1818
description='Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API',
1919
long_description=long_description,
@@ -23,7 +23,7 @@
2323
maintainer='Appwrite Team',
2424
maintainer_email='team@appwrite.io',
2525
url='https://appwrite.io/support',
26-
download_url='https://github.com/appwrite/sdk-for-python/archive/7.1.0.tar.gz',
26+
download_url='https://github.com/appwrite/sdk-for-python/archive/8.0.0.tar.gz',
2727
install_requires=[
2828
'requests',
2929
],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp