From a76fe5b558dc850bea1a180ad2d3ab5d173a3754 Mon Sep 17 00:00:00 2001 From: Jang Rush Date: Mon, 11 Oct 2021 19:32:43 +0800 Subject: [PATCH] docs: prepare to release 2.9.7 --- changelog | 6 ++++++ docs/_modules/leancloud/file_.html | 7 +++++-- setup.py | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/changelog b/changelog index d530ad1..cb7f784 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,9 @@ +## [2.9.7] - 2021-10-11 + +### Fixed +- onAuthData hook +- hide LCFile.url when failed to upload file + ## [2.9.6] - 2021-09-15 ### Added diff --git a/docs/_modules/leancloud/file_.html b/docs/_modules/leancloud/file_.html index 09628b6..a204d96 100644 --- a/docs/_modules/leancloud/file_.html +++ b/docs/_modules/leancloud/file_.html @@ -103,6 +103,7 @@

leancloud.file_ 源代码

         self.key = None
         self.id = None
         self._url = None
+        self._successful_url = None
         self._acl = None
         self.current_user = leancloud.User.get_current()
         self.timeout = 30
@@ -204,7 +205,7 @@ 

leancloud.file_ 源代码

 
     @property
     def url(self):
-        return self._url
+        return self._successful_url
 
     @property
     def mime_type(self):
@@ -229,7 +230,7 @@ 

leancloud.file_ 源代码

 
[文档] def get_thumbnail_url( self, width, height, quality=100, scale_to_fit=True, fmt="png" ): - if not self._url: + if not self.url: raise ValueError("invalid url") if width < 0 or height < 0: @@ -293,6 +294,7 @@

leancloud.file_ 源代码

         response = client.post("/files".format(self._name), data)
         content = response.json()
         self.id = content["objectId"]
+        self._successful_url = self._url
 
     def _save_to_qcloud(self, token, upload_url):
         headers = {
@@ -353,6 +355,7 @@ 

leancloud.file_ 源代码

             self._name = server_data.get("name")
         if "url" in server_data:
             self._url = server_data.get("url")
+            self._successful_url = self._url
         if "mime_type" in server_data:
             self._mime_type = server_data["mime_type"]
         if "metaData" in server_data:
diff --git a/setup.py b/setup.py
index 7d80b6f..42c9413 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@
 
 setup(
     name='leancloud',
-    version='2.9.6',
+    version='2.9.7',
     description='LeanCloud Python SDK',
     url='https://leancloud.cn/',
     author='asaka',