Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wgergely committed Oct 11, 2022
1 parent 99bb4b1 commit 2640d79
Show file tree
Hide file tree
Showing 128 changed files with 1,217 additions and 1,003 deletions.
2 changes: 1 addition & 1 deletion docs/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: dc6faf8763197313b0a1bdcca7583dde
config: daed2f8bc5c1b3d5fad2f7402881bf27
tags: 645f666f9bcd5a90fca523b33c5a78b7
83 changes: 66 additions & 17 deletions docs/html/_modules/bookmarks/actions.html

Large diffs are not rendered by default.

55 changes: 51 additions & 4 deletions docs/html/_modules/bookmarks/common/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../../../genindex.html" /><link rel="search" title="Search" href="../../../search.html" />

<meta name="generator" content="sphinx-5.2.2, furo 2022.09.15"/>
<title>bookmarks.common.core - Bookmarks 0.7.2 documentation</title>
<title>bookmarks.common.core - Bookmarks 0.7.3 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/furo.css?digest=9ec31e2665bf879c1d47d93a8ec4893870ee1e45" />
<link rel="stylesheet" type="text/css" href="../../../_static/design-style.4045f2051d55cab465a707391d5b2007.min.css" />
Expand Down Expand Up @@ -134,7 +134,7 @@
</label>
</div>
<div class="header-center">
<a href="../../../index.html"><div class="brand">Bookmarks 0.7.2 documentation</div></a>
<a href="../../../index.html"><div class="brand">Bookmarks 0.7.3 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -161,7 +161,7 @@
<img class="sidebar-logo only-dark" src="../../../_static/icon_bw.png" alt="Dark Logo"/>
</div>

<span class="sidebar-brand-text">Bookmarks 0.7.2 documentation</span>
<span class="sidebar-brand-text">Bookmarks 0.7.3 documentation</span>

</a><form class="sidebar-search-container" method="get" action="../../../search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
Expand Down Expand Up @@ -795,7 +795,6 @@ <h1>Source code for bookmarks.common.core</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">l</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">path</span><span class="si">}</span><span class="s1">/</span><span class="si">{</span><span class="n">common</span><span class="o">.</span><span class="n">link_file</span><span class="si">}</span><span class="s1">&#39;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">QtCore</span><span class="o">.</span><span class="n">QFileInfo</span><span class="p">(</span><span class="n">l</span><span class="p">)</span><span class="o">.</span><span class="n">exists</span><span class="p">():</span>
<span class="nb">print</span><span class="p">(</span><span class="n">l</span><span class="p">)</span>
<span class="k">return</span> <span class="p">[]</span>

<span class="n">s</span> <span class="o">=</span> <span class="n">QtCore</span><span class="o">.</span><span class="n">QSettings</span><span class="p">(</span><span class="n">l</span><span class="p">,</span> <span class="n">QtCore</span><span class="o">.</span><span class="n">QSettings</span><span class="o">.</span><span class="n">IniFormat</span><span class="p">)</span>
Expand Down Expand Up @@ -866,6 +865,54 @@ <h1>Source code for bookmarks.common.core</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">_data_type</span> <span class="o">=</span> <span class="n">v</span></div>


<span class="kn">import</span> <span class="nn">sys</span>


<span class="c1"># Custom objects know their class.</span>
<span class="c1"># Function objects seem to know way too much, including modules.</span>
<span class="c1"># Exclude modules as well.</span>


<div class="viewcode-block" id="byte_to_pretty_string"><a class="viewcode-back" href="../../../modules/common/core.html#bookmarks.common.core.byte_to_pretty_string">[docs]</a><span class="k">def</span> <span class="nf">byte_to_pretty_string</span><span class="p">(</span><span class="n">num</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s1">&#39;B&#39;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Converts a numeric byte value to a human-readable string.</span>

<span class="sd"> Args:</span>
<span class="sd"> num (int): The number of bytes.</span>
<span class="sd"> suffix (str): A custom suffix.</span>

<span class="sd"> Returns:</span>
<span class="sd"> str: Human readable byte value.</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">for</span> <span class="n">unit</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;K&#39;</span><span class="p">,</span> <span class="s1">&#39;M&#39;</span><span class="p">,</span> <span class="s1">&#39;G&#39;</span><span class="p">,</span> <span class="s1">&#39;T&#39;</span><span class="p">,</span> <span class="s1">&#39;P&#39;</span><span class="p">,</span> <span class="s1">&#39;E&#39;</span><span class="p">,</span> <span class="s1">&#39;Z&#39;</span><span class="p">]:</span>
<span class="k">if</span> <span class="nb">abs</span><span class="p">(</span><span class="n">num</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mf">1024.0</span><span class="p">:</span>
<span class="k">return</span> <span class="sa">u</span><span class="s2">&quot;</span><span class="si">%3.1f%s%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">num</span><span class="p">,</span> <span class="n">unit</span><span class="p">,</span> <span class="n">suffix</span><span class="p">)</span>
<span class="n">num</span> <span class="o">/=</span> <span class="mf">1024.0</span>
<span class="k">return</span> <span class="sa">u</span><span class="s2">&quot;</span><span class="si">%.1f%s%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">num</span><span class="p">,</span> <span class="s1">&#39;Yi&#39;</span><span class="p">,</span> <span class="n">suffix</span><span class="p">)</span></div>


<div class="viewcode-block" id="get_py_obj_size"><a class="viewcode-back" href="../../../modules/common/core.html#bookmarks.common.core.get_py_obj_size">[docs]</a><span class="k">def</span> <span class="nf">get_py_obj_size</span><span class="p">(</span><span class="n">obj</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Sum size of object &amp; members.</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">gc</span> <span class="kn">import</span> <span class="n">get_referents</span>
<span class="kn">from</span> <span class="nn">types</span> <span class="kn">import</span> <span class="n">ModuleType</span><span class="p">,</span> <span class="n">FunctionType</span>

<span class="n">exclude</span> <span class="o">=</span> <span class="p">(</span><span class="nb">type</span><span class="p">,</span> <span class="n">ModuleType</span><span class="p">,</span> <span class="n">FunctionType</span><span class="p">)</span>
<span class="n">seen_ids</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
<span class="n">size</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">objects</span> <span class="o">=</span> <span class="p">[</span><span class="n">obj</span><span class="p">]</span>
<span class="k">while</span> <span class="n">objects</span><span class="p">:</span>
<span class="n">need_referents</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">obj</span> <span class="ow">in</span> <span class="n">objects</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">exclude</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">id</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">seen_ids</span><span class="p">:</span>
<span class="n">seen_ids</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="nb">id</span><span class="p">(</span><span class="n">obj</span><span class="p">))</span>
<span class="n">size</span> <span class="o">+=</span> <span class="n">sys</span><span class="o">.</span><span class="n">getsizeof</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
<span class="n">need_referents</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
<span class="n">objects</span> <span class="o">=</span> <span class="n">get_referents</span><span class="p">(</span><span class="o">*</span><span class="n">need_referents</span><span class="p">)</span>
<span class="k">return</span> <span class="n">size</span></div>


<div class="viewcode-block" id="Timer"><a class="viewcode-back" href="../../../modules/common/core.html#bookmarks.common.core.Timer">[docs]</a><span class="k">class</span> <span class="nc">Timer</span><span class="p">(</span><span class="n">QtCore</span><span class="o">.</span><span class="n">QTimer</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;A custom QTimer class used across the app.</span>

Expand Down
15 changes: 9 additions & 6 deletions docs/html/_modules/bookmarks/common/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../../../genindex.html" /><link rel="search" title="Search" href="../../../search.html" />

<meta name="generator" content="sphinx-5.2.2, furo 2022.09.15"/>
<title>bookmarks.common.settings - Bookmarks 0.7.2 documentation</title>
<title>bookmarks.common.settings - Bookmarks 0.7.3 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/furo.css?digest=9ec31e2665bf879c1d47d93a8ec4893870ee1e45" />
<link rel="stylesheet" type="text/css" href="../../../_static/design-style.4045f2051d55cab465a707391d5b2007.min.css" />
Expand Down Expand Up @@ -134,7 +134,7 @@
</label>
</div>
<div class="header-center">
<a href="../../../index.html"><div class="brand">Bookmarks 0.7.2 documentation</div></a>
<a href="../../../index.html"><div class="brand">Bookmarks 0.7.3 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -161,7 +161,7 @@
<img class="sidebar-logo only-dark" src="../../../_static/icon_bw.png" alt="Dark Logo"/>
</div>

<span class="sidebar-brand-text">Bookmarks 0.7.2 documentation</span>
<span class="sidebar-brand-text">Bookmarks 0.7.3 documentation</span>

</a><form class="sidebar-search-container" method="get" action="../../../search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
Expand Down Expand Up @@ -717,7 +717,8 @@ <h1>Source code for bookmarks.common.settings</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">common</span><span class="o">.</span><span class="n">check_type</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">dict</span><span class="p">)</span>
<span class="n">common</span><span class="o">.</span><span class="n">servers</span> <span class="o">=</span> <span class="n">v</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">setValue</span><span class="p">(</span><span class="s1">&#39;user/servers&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">setValue</span><span class="p">(</span><span class="s1">&#39;user/servers&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span>
<span class="n">common</span><span class="o">.</span><span class="n">signals</span><span class="o">.</span><span class="n">serversChanged</span><span class="o">.</span><span class="n">emit</span><span class="p">()</span></div>

<div class="viewcode-block" id="UserSettings.set_bookmarks"><a class="viewcode-back" href="../../../modules/common/settings.html#bookmarks.common.settings.UserSettings.set_bookmarks">[docs]</a> <span class="k">def</span> <span class="nf">set_bookmarks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">v</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Set and save the given bookmark item values.</span>
Expand All @@ -728,7 +729,8 @@ <h1>Source code for bookmarks.common.settings</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">common</span><span class="o">.</span><span class="n">check_type</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">dict</span><span class="p">)</span>
<span class="n">common</span><span class="o">.</span><span class="n">bookmarks</span> <span class="o">=</span> <span class="n">v</span>
<span class="bp">self</span><span class="o">.</span><span class="n">setValue</span><span class="p">(</span><span class="s1">&#39;user/bookmarks&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">setValue</span><span class="p">(</span><span class="s1">&#39;user/bookmarks&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span>
<span class="n">common</span><span class="o">.</span><span class="n">signals</span><span class="o">.</span><span class="n">bookmarksChanged</span><span class="o">.</span><span class="n">emit</span><span class="p">()</span></div>

<div class="viewcode-block" id="UserSettings.set_favourites"><a class="viewcode-back" href="../../../modules/common/settings.html#bookmarks.common.settings.UserSettings.set_favourites">[docs]</a> <span class="k">def</span> <span class="nf">set_favourites</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">v</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Set and save the given favourite item values.</span>
Expand All @@ -739,7 +741,8 @@ <h1>Source code for bookmarks.common.settings</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">common</span><span class="o">.</span><span class="n">check_type</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">dict</span><span class="p">)</span>
<span class="n">common</span><span class="o">.</span><span class="n">favourites</span> <span class="o">=</span> <span class="n">v</span>
<span class="bp">self</span><span class="o">.</span><span class="n">setValue</span><span class="p">(</span><span class="s1">&#39;user/favourites&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">setValue</span><span class="p">(</span><span class="s1">&#39;user/favourites&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span>
<span class="n">common</span><span class="o">.</span><span class="n">signals</span><span class="o">.</span><span class="n">favouritesChanged</span><span class="o">.</span><span class="n">emit</span><span class="p">()</span></div>

<div class="viewcode-block" id="UserSettings.value"><a class="viewcode-back" href="../../../modules/common/settings.html#bookmarks.common.settings.UserSettings.value">[docs]</a> <span class="k">def</span> <span class="nf">value</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Get a value from the user settings file.</span>
Expand Down
9 changes: 5 additions & 4 deletions docs/html/_modules/bookmarks/common/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../../../genindex.html" /><link rel="search" title="Search" href="../../../search.html" />

<meta name="generator" content="sphinx-5.2.2, furo 2022.09.15"/>
<title>bookmarks.common.setup - Bookmarks 0.7.2 documentation</title>
<title>bookmarks.common.setup - Bookmarks 0.7.3 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/furo.css?digest=9ec31e2665bf879c1d47d93a8ec4893870ee1e45" />
<link rel="stylesheet" type="text/css" href="../../../_static/design-style.4045f2051d55cab465a707391d5b2007.min.css" />
Expand Down Expand Up @@ -134,7 +134,7 @@
</label>
</div>
<div class="header-center">
<a href="../../../index.html"><div class="brand">Bookmarks 0.7.2 documentation</div></a>
<a href="../../../index.html"><div class="brand">Bookmarks 0.7.3 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -161,7 +161,7 @@
<img class="sidebar-logo only-dark" src="../../../_static/icon_bw.png" alt="Dark Logo"/>
</div>

<span class="sidebar-brand-text">Bookmarks 0.7.2 documentation</span>
<span class="sidebar-brand-text">Bookmarks 0.7.3 documentation</span>

</a><form class="sidebar-search-container" method="get" action="../../../search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
Expand Down Expand Up @@ -407,7 +407,7 @@ <h1>Source code for bookmarks.common.setup</h1><div class="highlight"><pre>
<span class="n">_init_dpi</span><span class="p">()</span>

<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">images</span>
<span class="n">images</span><span class="o">.</span><span class="n">init_imagecache</span><span class="p">()</span>
<span class="n">images</span><span class="o">.</span><span class="n">init_image_cache</span><span class="p">()</span>
<span class="n">images</span><span class="o">.</span><span class="n">init_resources</span><span class="p">()</span>

<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">standalone</span>
Expand Down Expand Up @@ -466,6 +466,7 @@ <h1>Source code for bookmarks.common.setup</h1><div class="highlight"><pre>

<span class="n">common</span><span class="o">.</span><span class="n">Timer</span><span class="o">.</span><span class="n">delete_timers</span><span class="p">()</span>

<span class="c1"># This should reset all the object caches to their initial values</span>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">common</span><span class="o">.</span><span class="n">__initial_values__</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="nb">setattr</span><span class="p">(</span><span class="n">common</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span>

Expand Down
Loading

0 comments on commit 2640d79

Please sign in to comment.