diff --git a/appwrite/client.py b/appwrite/client.py index 1b908d1..be73fb8 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -13,11 +13,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : 'AppwritePythonSDK/7.1.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', + 'user-agent' : 'AppwritePythonSDK/8.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '7.1.0', + 'x-sdk-version': '8.0.0', 'X-Appwrite-Response-Format' : '1.6.0', } @@ -79,7 +79,7 @@ def call(self, method, path='', headers=None, params=None, response_type='json') data = {} files = {} stringify = False - + headers = {**self._global_headers, **headers} if method != 'get': @@ -170,12 +170,11 @@ def chunked_upload( offset = 0 counter = 0 - if upload_id != 'unique()': - try: - result = self.call('get', path + '/' + upload_id, headers) - counter = result['chunksUploaded'] - except: - pass + try: + result = self.call('get', path + '/' + upload_id, headers) + counter = result['chunksUploaded'] + except: + pass if counter > 0: offset = counter * self._chunk_size @@ -188,7 +187,7 @@ def chunked_upload( if offset + self._chunk_size < size: end = offset + self._chunk_size else: - end = size - offset + end = size input_file.data = input[offset:end] params[param_name] = input_file @@ -200,10 +199,10 @@ def chunked_upload( headers, params, ) - + offset = offset + self._chunk_size - - if "$id" in result: + + if "$id" in result: headers["x-appwrite-id"] = result["$id"] if on_progress is not None: @@ -229,7 +228,7 @@ def flatten(self, data, prefix='', stringify=False): finalKey = prefix + '[' + key +']' if prefix else key finalKey = prefix + '[' + str(i) +']' if isinstance(data, list) else finalKey i += 1 - + if isinstance(value, list) or isinstance(value, dict): output = {**output, **self.flatten(value, finalKey, stringify)} else: @@ -239,4 +238,3 @@ def flatten(self, data, prefix='', stringify=False): output[finalKey] = value return output - diff --git a/appwrite/enums/image_format.py b/appwrite/enums/image_format.py index d507d17..ba2f59e 100644 --- a/appwrite/enums/image_format.py +++ b/appwrite/enums/image_format.py @@ -6,4 +6,5 @@ class ImageFormat(Enum): GIF = "gif" PNG = "png" WEBP = "webp" + HEIC = "heic" AVIF = "avif" diff --git a/setup.py b/setup.py index e349204..558311d 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'appwrite/encoders', 'appwrite/enums', ], - version = '7.1.0', + version = '8.0.0' license='BSD-3-Clause', 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', long_description = long_description, @@ -23,7 +23,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/7.1.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/8.0.0.tar.gz', install_requires=[ 'requests', ],