Skip to content

Commit

Permalink
Merge pull request #532 from leancloud/297
Browse files Browse the repository at this point in the history
docs: prepare to release 2.9.7
  • Loading branch information
weakish authored Oct 11, 2021
2 parents b22011b + a76fe5b commit 0f1bf69
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 5 additions & 2 deletions docs/_modules/leancloud/file_.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ <h1>leancloud.file_ 源代码</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="o">=</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_url</span> <span class="o">=</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_successful_url</span> <span class="o">=</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_acl</span> <span class="o">=</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">current_user</span> <span class="o">=</span> <span class="n">leancloud</span><span class="o">.</span><span class="n">User</span><span class="o">.</span><span class="n">get_current</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">timeout</span> <span class="o">=</span> <span class="mi">30</span>
Expand Down Expand Up @@ -204,7 +205,7 @@ <h1>leancloud.file_ 源代码</h1><div class="highlight"><pre>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">url</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_url</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_successful_url</span>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">mime_type</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
Expand All @@ -229,7 +230,7 @@ <h1>leancloud.file_ 源代码</h1><div class="highlight"><pre>
<div class="viewcode-block" id="File.get_thumbnail_url"><a class="viewcode-back" href="../../index.html#leancloud.File.get_thumbnail_url">[文档]</a> <span class="k">def</span> <span class="nf">get_thumbnail_url</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="p">,</span> <span class="n">quality</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span> <span class="n">scale_to_fit</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">fmt</span><span class="o">=</span><span class="s2">&quot;png&quot;</span>
<span class="p">):</span>
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_url</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">url</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;invalid url&quot;</span><span class="p">)</span>

<span class="k">if</span> <span class="n">width</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">or</span> <span class="n">height</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">:</span>
Expand Down Expand Up @@ -293,6 +294,7 @@ <h1>leancloud.file_ 源代码</h1><div class="highlight"><pre>
<span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post</span><span class="p">(</span><span class="s2">&quot;/files&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_name</span><span class="p">),</span> <span class="n">data</span><span class="p">)</span>
<span class="n">content</span> <span class="o">=</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="n">content</span><span class="p">[</span><span class="s2">&quot;objectId&quot;</span><span class="p">]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_successful_url</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_url</span>

<span class="k">def</span> <span class="nf">_save_to_qcloud</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">token</span><span class="p">,</span> <span class="n">upload_url</span><span class="p">):</span>
<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
Expand Down Expand Up @@ -353,6 +355,7 @@ <h1>leancloud.file_ 源代码</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">_name</span> <span class="o">=</span> <span class="n">server_data</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="s2">&quot;url&quot;</span> <span class="ow">in</span> <span class="n">server_data</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_url</span> <span class="o">=</span> <span class="n">server_data</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;url&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_successful_url</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_url</span>
<span class="k">if</span> <span class="s2">&quot;mime_type&quot;</span> <span class="ow">in</span> <span class="n">server_data</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_mime_type</span> <span class="o">=</span> <span class="n">server_data</span><span class="p">[</span><span class="s2">&quot;mime_type&quot;</span><span class="p">]</span>
<span class="k">if</span> <span class="s2">&quot;metaData&quot;</span> <span class="ow">in</span> <span class="n">server_data</span><span class="p">:</span>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 0f1bf69

Please sign in to comment.