Skip to content

Commit

Permalink
added prog mode #2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpdev committed Aug 28, 2023
1 parent 54b6b2c commit ed9169e
Show file tree
Hide file tree
Showing 57 changed files with 1,697 additions and 1,646 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- major edits to the way progress bars are tracked in all modules
- other bug fixes

---

## Version 0.9.1

- Clean up and consolidate many cli help strings
Expand Down
196 changes: 122 additions & 74 deletions docs/Source/hasher/index.html

Large diffs are not rendered by default.

60 changes: 23 additions & 37 deletions docs/Source/mixins/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,8 @@ <h5 id="torrentfile.mixins.ProgMixin.NoProg.update" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>torrentfile\mixins.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">205</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">204</span>
<span class="normal">205</span>
<span class="normal">206</span>
<span class="normal">207</span>
<span class="normal">208</span>
Expand All @@ -1014,8 +1015,7 @@ <h5 id="torrentfile.mixins.ProgMixin.NoProg.update" class="doc doc-heading">
<span class="normal">215</span>
<span class="normal">216</span>
<span class="normal">217</span>
<span class="normal">218</span>
<span class="normal">219</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="normal">218</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return the value.</span>

Expand Down Expand Up @@ -1117,7 +1117,8 @@ <h4 id="torrentfile.mixins.ProgMixin.get_progress_tracker" class="doc doc-headin

<details class="quote">
<summary>Source code in <code>torrentfile\mixins.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">221</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">220</span>
<span class="normal">221</span>
<span class="normal">222</span>
<span class="normal">223</span>
<span class="normal">224</span>
Expand All @@ -1133,8 +1134,7 @@ <h4 id="torrentfile.mixins.ProgMixin.get_progress_tracker" class="doc doc-headin
<span class="normal">234</span>
<span class="normal">235</span>
<span class="normal">236</span>
<span class="normal">237</span>
<span class="normal">238</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">get_progress_tracker</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">total</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">message</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="normal">237</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">get_progress_tracker</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">total</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">message</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Return the progress bar object for external management.</span>

<span class="sd"> Parameters</span>
Expand Down Expand Up @@ -1287,11 +1287,13 @@ <h3 id="torrentfile.mixins.ProgressBar" class="doc doc-heading">
<span class="normal">102</span>
<span class="normal">103</span>
<span class="normal">104</span>
<span class="normal">105</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">total</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">length</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">unit</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="normal">105</span>
<span class="normal">106</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">total</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">length</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">unit</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">start</span><span class="p">:</span> <span class="nb">int</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Construct the progress bar object and store state of it&#39;s properties.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">debug_is_on</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">total</span> <span class="o">=</span> <span class="n">total</span>
<span class="bp">self</span><span class="o">.</span><span class="n">start</span> <span class="o">=</span> <span class="n">start</span>
<span class="bp">self</span><span class="o">.</span><span class="n">length</span> <span class="o">=</span> <span class="n">length</span>
Expand Down Expand Up @@ -1351,15 +1353,15 @@ <h4 id="torrentfile.mixins.ProgressBar.close_out" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>torrentfile\mixins.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">134</span>
<span class="normal">135</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">135</span>
<span class="normal">136</span>
<span class="normal">137</span>
<span class="normal">138</span>
<span class="normal">139</span>
<span class="normal">140</span>
<span class="normal">141</span>
<span class="normal">142</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">close_out</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="normal">142</span>
<span class="normal">143</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">close_out</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Finalize the last bits of progress bar.</span>

Expand Down Expand Up @@ -1415,8 +1417,7 @@ <h4 id="torrentfile.mixins.ProgressBar.get_progress" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>torrentfile\mixins.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">107</span>
<span class="normal">108</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">108</span>
<span class="normal">109</span>
<span class="normal">110</span>
<span class="normal">111</span>
Expand All @@ -1440,7 +1441,8 @@ <h4 id="torrentfile.mixins.ProgressBar.get_progress" class="doc doc-heading">
<span class="normal">129</span>
<span class="normal">130</span>
<span class="normal">131</span>
<span class="normal">132</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">get_progress</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="normal">132</span>
<span class="normal">133</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">get_progress</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return the size of the filled portion of the progress bar.</span>

Expand Down Expand Up @@ -1554,25 +1556,12 @@ <h4 id="torrentfile.mixins.ProgressBar.new" class="doc doc-heading">
</p>
</td>
</tr>
<tr>
<td><code>mode</code></td>
<td class="doc-param-details">
<p>the progress bar mode</p>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code>int</code>
</span>
</p>
</td>
</tr>
</tbody>
</table>

<details class="quote">
<summary>Source code in <code>torrentfile\mixins.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">161</span>
<span class="normal">162</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">162</span>
<span class="normal">163</span>
<span class="normal">164</span>
<span class="normal">165</span>
Expand Down Expand Up @@ -1600,8 +1589,7 @@ <h4 id="torrentfile.mixins.ProgressBar.new" class="doc doc-heading">
<span class="normal">187</span>
<span class="normal">188</span>
<span class="normal">189</span>
<span class="normal">190</span>
<span class="normal">191</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="nd">@classmethod</span>
<span class="normal">190</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">new</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">total</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">length</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">50</span><span class="p">,</span> <span class="n">unit</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&quot;bytes&quot;</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Generate a new progress bar for the given file path.</span>
Expand All @@ -1616,8 +1604,6 @@ <h4 id="torrentfile.mixins.ProgressBar.new" class="doc doc-heading">
<span class="sd"> the number of characters of the actual progress bar.</span>
<span class="sd"> unit : str</span>
<span class="sd"> the text representation of the value being measured.</span>
<span class="sd"> mode : int</span>
<span class="sd"> the progress bar mode</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">title</span> <span class="o">=</span> <span class="n">path</span>
<span class="n">width</span> <span class="o">=</span> <span class="n">shutil</span><span class="o">.</span><span class="n">get_terminal_size</span><span class="p">()</span><span class="o">.</span><span class="n">columns</span>
Expand Down Expand Up @@ -1678,8 +1664,7 @@ <h4 id="torrentfile.mixins.ProgressBar.update" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>torrentfile\mixins.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">144</span>
<span class="normal">145</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">145</span>
<span class="normal">146</span>
<span class="normal">147</span>
<span class="normal">148</span>
Expand All @@ -1693,7 +1678,8 @@ <h4 id="torrentfile.mixins.ProgressBar.update" class="doc doc-heading">
<span class="normal">156</span>
<span class="normal">157</span>
<span class="normal">158</span>
<span class="normal">159</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">val</span><span class="p">:</span> <span class="nb">int</span><span class="p">):</span>
<span class="normal">159</span>
<span class="normal">160</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">val</span><span class="p">:</span> <span class="nb">int</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Update progress bar.</span>

Expand Down Expand Up @@ -1791,7 +1777,8 @@ <h3 id="torrentfile.mixins.waiting" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>torrentfile\mixins.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">241</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">240</span>
<span class="normal">241</span>
<span class="normal">242</span>
<span class="normal">243</span>
<span class="normal">244</span>
Expand Down Expand Up @@ -1830,8 +1817,7 @@ <h3 id="torrentfile.mixins.waiting" class="doc doc-heading">
<span class="normal">277</span>
<span class="normal">278</span>
<span class="normal">279</span>
<span class="normal">280</span>
<span class="normal">281</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">waiting</span><span class="p">(</span><span class="n">msg</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">flag</span><span class="p">:</span> <span class="nb">list</span><span class="p">,</span> <span class="n">timeout</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">20</span><span class="p">):</span>
<span class="normal">280</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">waiting</span><span class="p">(</span><span class="n">msg</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">flag</span><span class="p">:</span> <span class="nb">list</span><span class="p">,</span> <span class="n">timeout</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">20</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Show loading message while thread completes processing.</span>

Expand Down
1 change: 1 addition & 0 deletions docs/changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,7 @@ <h2 id="version-092">Version 0.9.2<a class="headerlink" href="#version-092" titl
<li>major edits to the way progress bars are tracked in all modules</li>
<li>other bug fixes</li>
</ul>
<hr />
<h2 id="version-091">Version 0.9.1<a class="headerlink" href="#version-091" title="Permanent link">#</a></h2>
<ul>
<li>Clean up and consolidate many cli help strings</li>
Expand Down
20 changes: 10 additions & 10 deletions docs/coverage/covindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<header>
<div class="content">
<h1>Coverage report:
<span class="pc_cov">99%</span>
<span class="pc_cov">100%</span>
</h1>
<aside id="help_panel_wrapper">
<input id="help_panel_state" type="checkbox">
Expand Down Expand Up @@ -45,7 +45,7 @@ <h1>Coverage report:
</form>
<p class="text">
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-27 20:55 -0700
created at 2023-08-27 21:04 -0700
</p>
</div>
</header>
Expand Down Expand Up @@ -175,10 +175,10 @@ <h1>Coverage report:
</tr>
<tr class="file">
<td class="name left"><a href="d_1bc82e0ab2fcb2ec_mixins_py.html">torrentfile\mixins.py</a></td>
<td>104</td>
<td>105</td>
<td>0</td>
<td>4</td>
<td class="right" data-ratio="104 104">100%</td>
<td class="right" data-ratio="105 105">100%</td>
</tr>
<tr class="file">
<td class="name left"><a href="d_1bc82e0ab2fcb2ec_rebuild_py.html">torrentfile\rebuild.py</a></td>
Expand All @@ -204,9 +204,9 @@ <h1>Coverage report:
<tr class="file">
<td class="name left"><a href="d_1bc82e0ab2fcb2ec_utils_py.html">torrentfile\utils.py</a></td>
<td>133</td>
<td>1</td>
<td>0</td>
<td>8</td>
<td class="right" data-ratio="132 133">99%</td>
<td class="right" data-ratio="133 133">100%</td>
</tr>
<tr class="file">
<td class="name left"><a href="d_1bc82e0ab2fcb2ec_version_py.html">torrentfile\version.py</a></td>
Expand All @@ -219,10 +219,10 @@ <h1>Coverage report:
<tfoot>
<tr class="total">
<td class="name left">Total</td>
<td>3028</td>
<td>1</td>
<td>3029</td>
<td>0</td>
<td>69</td>
<td class="right" data-ratio="3027 3028">99%</td>
<td class="right" data-ratio="3029 3029">100%</td>
</tr>
</tfoot>
</table>
Expand All @@ -234,7 +234,7 @@ <h1>Coverage report:
<div class="content">
<p>
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-27 20:55 -0700
created at 2023-08-27 21:04 -0700
</p>
</div>
<aside class="hidden">
Expand Down
4 changes: 2 additions & 2 deletions docs/coverage/d_1bc82e0ab2fcb2ec___init___py.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_1bc82e0ab2fcb2ec___main___py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-27 20:55 -0700
created at 2023-08-27 21:04 -0700
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -132,7 +132,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_1bc82e0ab2fcb2ec___main___py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-27 20:55 -0700
created at 2023-08-27 21:04 -0700
</p>
</div>
</footer>
Expand Down
Loading

0 comments on commit ed9169e

Please sign in to comment.