mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +00:00
Update site to include help
- Add sphinx documentation generated from build to help - Add link to help (in english) in header - Add link to github in header
This commit is contained in:
363
help/en/developer/core/app.html
Normal file
363
help/en/developer/core/app.html
Normal file
@@ -0,0 +1,363 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>core.app — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="core.fs" href="fs.html" />
|
||||
<link rel="prev" title="core" href="index.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>core.app</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="index.html">core</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="fs.html">core.fs</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-core.app">
|
||||
<span id="core-app"></span><h1>core.app<a class="headerlink" href="#module-core.app" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="class">
|
||||
<dt id="core.app.DupeGuru">
|
||||
<em class="property">class </em><code class="descclassname">core.app.</code><code class="descname">DupeGuru</code><span class="sig-paren">(</span><em>view</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Holds everything together.</p>
|
||||
<p>Instantiated once per running application, it holds a reference to every high-level object
|
||||
whose reference needs to be held: <a class="reference internal" href="results.html#core.results.Results" title="core.results.Results"><code class="xref py py-class docutils literal notranslate"><span class="pre">Results</span></code></a>,
|
||||
<a class="reference internal" href="directories.html#core.directories.Directories" title="core.directories.Directories"><code class="xref py py-class docutils literal notranslate"><span class="pre">Directories</span></code></a>, <a class="reference internal" href="gui/index.html#module-core.gui" title="core.gui"><code class="xref py py-mod docutils literal notranslate"><span class="pre">core.gui</span></code></a> instances, etc..</p>
|
||||
<p>It also hosts high level methods and acts as a coordinator for all those elements. This is why
|
||||
some of its methods seem a bit shallow, like for example <a class="reference internal" href="#core.app.DupeGuru.mark_all" title="core.app.DupeGuru.mark_all"><code class="xref py py-meth docutils literal notranslate"><span class="pre">mark_all()</span></code></a> and
|
||||
<a class="reference internal" href="#core.app.DupeGuru.remove_duplicates" title="core.app.DupeGuru.remove_duplicates"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove_duplicates()</span></code></a>. These methos are just proxies for a method in <a class="reference internal" href="#core.app.DupeGuru.results" title="core.app.DupeGuru.results"><code class="xref py py-attr docutils literal notranslate"><span class="pre">results</span></code></a>, but
|
||||
they are also followed by a notification call which is very important if we want GUI elements
|
||||
to be correctly notified of a change in the data they’re presenting.</p>
|
||||
<dl class="attribute">
|
||||
<dt id="core.app.DupeGuru.directories">
|
||||
<code class="descname">directories</code><a class="headerlink" href="#core.app.DupeGuru.directories" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Instance of <a class="reference internal" href="directories.html#core.directories.Directories" title="core.directories.Directories"><code class="xref py py-class docutils literal notranslate"><span class="pre">Directories</span></code></a>. It holds the current folder selection.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.app.DupeGuru.results">
|
||||
<code class="descname">results</code><a class="headerlink" href="#core.app.DupeGuru.results" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Instance of <a class="reference internal" href="results.html#core.results.Results" title="core.results.Results"><code class="xref py py-class docutils literal notranslate"><span class="pre">core.results.Results</span></code></a>. Holds the results of the latest scan.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.app.DupeGuru.selected_dupes">
|
||||
<code class="descname">selected_dupes</code><a class="headerlink" href="#core.app.DupeGuru.selected_dupes" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>List of currently selected dupes from our <a class="reference internal" href="#core.app.DupeGuru.results" title="core.app.DupeGuru.results"><code class="xref py py-attr docutils literal notranslate"><span class="pre">results</span></code></a>. Whenever the user changes its
|
||||
selection at the UI level, <a class="reference internal" href="#core.app.DupeGuru.result_table" title="core.app.DupeGuru.result_table"><code class="xref py py-attr docutils literal notranslate"><span class="pre">result_table</span></code></a> takes care of updating this attribute, so
|
||||
you can trust that it’s always up-to-date.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.app.DupeGuru.result_table">
|
||||
<code class="descname">result_table</code><a class="headerlink" href="#core.app.DupeGuru.result_table" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Instance of <a class="reference internal" href="gui/index.html#module-core.gui" title="core.gui"><code class="xref py py-mod docutils literal notranslate"><span class="pre">meta-gui</span></code></a> table listing the results from <a class="reference internal" href="#core.app.DupeGuru.results" title="core.app.DupeGuru.results"><code class="xref py py-attr docutils literal notranslate"><span class="pre">results</span></code></a></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.add_directory">
|
||||
<code class="descname">add_directory</code><span class="sig-paren">(</span><em>d</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.add_directory" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Adds folder <code class="docutils literal notranslate"><span class="pre">d</span></code> to <a class="reference internal" href="#core.app.DupeGuru.directories" title="core.app.DupeGuru.directories"><code class="xref py py-attr docutils literal notranslate"><span class="pre">directories</span></code></a>.</p>
|
||||
<p>Shows an error message dialog if something bad happens.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>d</strong> (<em>str</em>) – path of folder to add</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.add_selected_to_ignore_list">
|
||||
<code class="descname">add_selected_to_ignore_list</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.add_selected_to_ignore_list" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Adds <a class="reference internal" href="#core.app.DupeGuru.selected_dupes" title="core.app.DupeGuru.selected_dupes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_dupes</span></code></a> to <code class="xref py py-attr docutils literal notranslate"><span class="pre">ignore_list</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.apply_filter">
|
||||
<code class="descname">apply_filter</code><span class="sig-paren">(</span><em>filter</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.apply_filter" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Apply a filter <code class="docutils literal notranslate"><span class="pre">filter</span></code> to the results so that it shows only dupe groups that match it.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filter</strong> (<em>str</em>) – filter to apply</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.copy_or_move_marked">
|
||||
<code class="descname">copy_or_move_marked</code><span class="sig-paren">(</span><em>copy</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.copy_or_move_marked" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Start an async move (or copy) job on marked duplicates.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>copy</strong> (<em>bool</em>) – If True, duplicates will be copied instead of moved</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.delete_marked">
|
||||
<code class="descname">delete_marked</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.delete_marked" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Start an async job to send marked duplicates to the trash.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.export_to_csv">
|
||||
<code class="descname">export_to_csv</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.export_to_csv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Export current results to CSV.</p>
|
||||
<p>The columns and their order in the resulting CSV file is determined in the same way as in
|
||||
<a class="reference internal" href="#core.app.DupeGuru.export_to_xhtml" title="core.app.DupeGuru.export_to_xhtml"><code class="xref py py-meth docutils literal notranslate"><span class="pre">export_to_xhtml()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.export_to_xhtml">
|
||||
<code class="descname">export_to_xhtml</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.export_to_xhtml" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Export current results to XHTML.</p>
|
||||
<p>The configuration of the <a class="reference internal" href="#core.app.DupeGuru.result_table" title="core.app.DupeGuru.result_table"><code class="xref py py-attr docutils literal notranslate"><span class="pre">result_table</span></code></a> (columns order and visibility) is used to
|
||||
determine how the data is presented in the export. In other words, the exported table in
|
||||
the resulting XHTML will look just like the results table.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.invoke_custom_command">
|
||||
<code class="descname">invoke_custom_command</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.invoke_custom_command" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Calls command in <code class="docutils literal notranslate"><span class="pre">CustomCommand</span></code> pref with <code class="docutils literal notranslate"><span class="pre">%d</span></code> and <code class="docutils literal notranslate"><span class="pre">%r</span></code> placeholders replaced.</p>
|
||||
<p>Using the current selection, <code class="docutils literal notranslate"><span class="pre">%d</span></code> is replaced with the currently selected dupe and <code class="docutils literal notranslate"><span class="pre">%r</span></code>
|
||||
is replaced with that dupe’s ref file. If there’s no selection, the command is not invoked.
|
||||
If the dupe is a ref, <code class="docutils literal notranslate"><span class="pre">%d</span></code> and <code class="docutils literal notranslate"><span class="pre">%r</span></code> will be the same.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.load">
|
||||
<code class="descname">load</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.load" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Load directory selection and ignore list from files in appdata.</p>
|
||||
<p>This method is called during startup so that directory selection and ignore list, which
|
||||
is persistent data, is the same as when the last session was closed (when <code class="xref py py-meth docutils literal notranslate"><span class="pre">save()</span></code> was
|
||||
called).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.load_from">
|
||||
<code class="descname">load_from</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.load_from" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Start an async job to load results from <code class="docutils literal notranslate"><span class="pre">filename</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> (<em>str</em>) – path of the XML file (created with <a class="reference internal" href="#core.app.DupeGuru.save_as" title="core.app.DupeGuru.save_as"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_as()</span></code></a>) to load</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.make_selected_reference">
|
||||
<code class="descname">make_selected_reference</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.make_selected_reference" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Promote <a class="reference internal" href="#core.app.DupeGuru.selected_dupes" title="core.app.DupeGuru.selected_dupes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_dupes</span></code></a> to reference position within their respective groups.</p>
|
||||
<p>Each selected dupe will become the <a class="reference internal" href="engine.html#core.engine.Group.ref" title="core.engine.Group.ref"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ref</span></code></a> of its group. If there’s
|
||||
more than one dupe selected for the same group, only the first (in the order currently shown
|
||||
in <a class="reference internal" href="#core.app.DupeGuru.result_table" title="core.app.DupeGuru.result_table"><code class="xref py py-attr docutils literal notranslate"><span class="pre">result_table</span></code></a>) dupe will be promoted.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.mark_all">
|
||||
<code class="descname">mark_all</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.mark_all" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set all dupes in the results as marked.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.mark_dupe">
|
||||
<code class="descname">mark_dupe</code><span class="sig-paren">(</span><em>dupe</em>, <em>marked</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.mark_dupe" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Change marked status of <code class="docutils literal notranslate"><span class="pre">dupe</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>dupe</strong> (<a class="reference internal" href="fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a>) – dupe to mark/unmark</li>
|
||||
<li><strong>marked</strong> (<em>bool</em>) – True = mark, False = unmark</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.mark_invert">
|
||||
<code class="descname">mark_invert</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.mark_invert" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Invert the marked state of all dupes in the results.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.mark_none">
|
||||
<code class="descname">mark_none</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.mark_none" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set all dupes in the results as unmarked.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.open_selected">
|
||||
<code class="descname">open_selected</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.open_selected" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Open <a class="reference internal" href="#core.app.DupeGuru.selected_dupes" title="core.app.DupeGuru.selected_dupes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_dupes</span></code></a> with their associated application.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.purge_ignore_list">
|
||||
<code class="descname">purge_ignore_list</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.purge_ignore_list" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Remove files that don’t exist from <code class="xref py py-attr docutils literal notranslate"><span class="pre">ignore_list</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.remove_directories">
|
||||
<code class="descname">remove_directories</code><span class="sig-paren">(</span><em>indexes</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.remove_directories" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Remove root directories at <code class="docutils literal notranslate"><span class="pre">indexes</span></code> from <a class="reference internal" href="#core.app.DupeGuru.directories" title="core.app.DupeGuru.directories"><code class="xref py py-attr docutils literal notranslate"><span class="pre">directories</span></code></a>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>indexes</strong> (<em>list of int</em>) – Indexes of the directories to remove.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.remove_duplicates">
|
||||
<code class="descname">remove_duplicates</code><span class="sig-paren">(</span><em>duplicates</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.remove_duplicates" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Remove <code class="docutils literal notranslate"><span class="pre">duplicates</span></code> from <a class="reference internal" href="#core.app.DupeGuru.results" title="core.app.DupeGuru.results"><code class="xref py py-attr docutils literal notranslate"><span class="pre">results</span></code></a>.</p>
|
||||
<p>Calls <a class="reference internal" href="results.html#core.results.Results.remove_duplicates" title="core.results.Results.remove_duplicates"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remove_duplicates()</span></code></a> and send appropriate notifications.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>duplicates</strong> (list of <a class="reference internal" href="fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a>) – duplicates to remove.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.remove_marked">
|
||||
<code class="descname">remove_marked</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.remove_marked" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Removed marked duplicates from the results (without touching the files themselves).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.remove_selected">
|
||||
<code class="descname">remove_selected</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.remove_selected" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Removed <a class="reference internal" href="#core.app.DupeGuru.selected_dupes" title="core.app.DupeGuru.selected_dupes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_dupes</span></code></a> from the results (without touching the files themselves).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.rename_selected">
|
||||
<code class="descname">rename_selected</code><span class="sig-paren">(</span><em>newname</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.rename_selected" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Renames the selected dupes’s file to <code class="docutils literal notranslate"><span class="pre">newname</span></code>.</p>
|
||||
<p>If there’s more than one selected dupes, the first one is used.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>newname</strong> (<em>str</em>) – The filename to rename the dupe’s file to.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.reprioritize_groups">
|
||||
<code class="descname">reprioritize_groups</code><span class="sig-paren">(</span><em>sort_key</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.reprioritize_groups" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Sort dupes in each group (in <a class="reference internal" href="#core.app.DupeGuru.results" title="core.app.DupeGuru.results"><code class="xref py py-attr docutils literal notranslate"><span class="pre">results</span></code></a>) according to <code class="docutils literal notranslate"><span class="pre">sort_key</span></code>.</p>
|
||||
<p>Called by the re-prioritize dialog. Calls <a class="reference internal" href="engine.html#core.engine.Group.prioritize" title="core.engine.Group.prioritize"><code class="xref py py-meth docutils literal notranslate"><span class="pre">prioritize()</span></code></a> and, once
|
||||
the sorting is done, show a message that confirms the action.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>sort_key</strong> (<em>f</em><em>(</em><em>dupe</em><em>)</em>) – The key being sent to <a class="reference internal" href="engine.html#core.engine.Group.prioritize" title="core.engine.Group.prioritize"><code class="xref py py-meth docutils literal notranslate"><span class="pre">prioritize()</span></code></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.save_as">
|
||||
<code class="descname">save_as</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.save_as" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Save results in <code class="docutils literal notranslate"><span class="pre">filename</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> (<em>str</em>) – path of the file to save results (as XML) to.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.start_scanning">
|
||||
<code class="descname">start_scanning</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.start_scanning" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Starts an async job to scan for duplicates.</p>
|
||||
<p>Scans folders selected in <a class="reference internal" href="#core.app.DupeGuru.directories" title="core.app.DupeGuru.directories"><code class="xref py py-attr docutils literal notranslate"><span class="pre">directories</span></code></a> and put the results in <a class="reference internal" href="#core.app.DupeGuru.results" title="core.app.DupeGuru.results"><code class="xref py py-attr docutils literal notranslate"><span class="pre">results</span></code></a></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.app.DupeGuru.without_ref">
|
||||
<code class="descname">without_ref</code><span class="sig-paren">(</span><em>dupes</em><span class="sig-paren">)</span><a class="headerlink" href="#core.app.DupeGuru.without_ref" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">dupes</span></code> with all reference elements removed.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="index.html">core</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="fs.html">core.fs</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
219
help/en/developer/core/directories.html
Normal file
219
help/en/developer/core/directories.html
Normal file
@@ -0,0 +1,219 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>core.directories — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="core.results" href="results.html" />
|
||||
<link rel="prev" title="core.engine" href="engine.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>core.directories</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="engine.html">core.engine</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="results.html">core.results</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-core.directories">
|
||||
<span id="core-directories"></span><h1>core.directories<a class="headerlink" href="#module-core.directories" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="exception">
|
||||
<dt id="core.directories.AlreadyThereError">
|
||||
<em class="property">exception </em><code class="descclassname">core.directories.</code><code class="descname">AlreadyThereError</code><a class="headerlink" href="#core.directories.AlreadyThereError" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The path being added is already in the directory list</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="exception">
|
||||
<dt id="core.directories.InvalidPathError">
|
||||
<em class="property">exception </em><code class="descclassname">core.directories.</code><code class="descname">InvalidPathError</code><a class="headerlink" href="#core.directories.InvalidPathError" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The path being added is invalid</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="core.directories.Directories">
|
||||
<em class="property">class </em><code class="descclassname">core.directories.</code><code class="descname">Directories</code><a class="headerlink" href="#core.directories.Directories" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Holds user folder selection.</p>
|
||||
<p>Manages the selection that the user make through the folder selection dialog. It also manages
|
||||
folder states, and how recursion applies to them.</p>
|
||||
<p>Then, when the user starts the scan, <a class="reference internal" href="#core.directories.Directories.get_files" title="core.directories.Directories.get_files"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_files()</span></code></a> is called to retrieve all files (wrapped
|
||||
in <a class="reference internal" href="fs.html#module-core.fs" title="core.fs"><code class="xref py py-mod docutils literal notranslate"><span class="pre">core.fs</span></code></a>) that have to be scanned according to the chosen folders/states.</p>
|
||||
<dl class="method">
|
||||
<dt id="core.directories.Directories.add_path">
|
||||
<code class="descname">add_path</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#core.directories.Directories.add_path" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Adds <code class="docutils literal notranslate"><span class="pre">path</span></code> to self, if not already there.</p>
|
||||
<p>Raises <a class="reference internal" href="#core.directories.AlreadyThereError" title="core.directories.AlreadyThereError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">AlreadyThereError</span></code></a> if <code class="docutils literal notranslate"><span class="pre">path</span></code> is already in self. If path is a directory
|
||||
containing some of the directories already present in self, <code class="docutils literal notranslate"><span class="pre">path</span></code> will be added, but all
|
||||
directories under it will be removed. Can also raise <a class="reference internal" href="#core.directories.InvalidPathError" title="core.directories.InvalidPathError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">InvalidPathError</span></code></a> if <code class="docutils literal notranslate"><span class="pre">path</span></code>
|
||||
does not exist.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> (<a class="reference internal" href="../hscommon/path.html#hscommon.path.Path" title="hscommon.path.Path"><em>Path</em></a>) – path to add</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.directories.Directories.get_files">
|
||||
<code class="descname">get_files</code><span class="sig-paren">(</span><em>fileclasses=None</em>, <em>j=<hscommon.jobprogress.job.NullJob object></em><span class="sig-paren">)</span><a class="headerlink" href="#core.directories.Directories.get_files" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a list of all files that are not excluded.</p>
|
||||
<p>Returned files also have their <code class="docutils literal notranslate"><span class="pre">is_ref</span></code> attr set if applicable.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.directories.Directories.get_folders">
|
||||
<code class="descname">get_folders</code><span class="sig-paren">(</span><em>folderclass=None</em>, <em>j=<hscommon.jobprogress.job.NullJob object></em><span class="sig-paren">)</span><a class="headerlink" href="#core.directories.Directories.get_folders" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a list of all folders that are not excluded.</p>
|
||||
<p>Returned folders also have their <code class="docutils literal notranslate"><span class="pre">is_ref</span></code> attr set if applicable.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.directories.Directories.get_state">
|
||||
<code class="descname">get_state</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#core.directories.Directories.get_state" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the state of <code class="docutils literal notranslate"><span class="pre">path</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#core.directories.DirectoryState" title="core.directories.DirectoryState"><code class="xref py py-class docutils literal notranslate"><span class="pre">DirectoryState</span></code></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="staticmethod">
|
||||
<dt id="core.directories.Directories.get_subfolders">
|
||||
<em class="property">static </em><code class="descname">get_subfolders</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.directories.Directories.get_subfolders" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a sorted list of paths corresponding to subfolders in <code class="docutils literal notranslate"><span class="pre">path</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> (<a class="reference internal" href="../hscommon/path.html#hscommon.path.Path" title="hscommon.path.Path"><em>Path</em></a>) – get subfolders from there</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list of Path</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.directories.Directories.has_any_file">
|
||||
<code class="descname">has_any_file</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.directories.Directories.has_any_file" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns whether selected folders contain any file.</p>
|
||||
<p>Because it stops at the first file it finds, it’s much faster than get_files().</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.directories.Directories.load_from_file">
|
||||
<code class="descname">load_from_file</code><span class="sig-paren">(</span><em>infile</em><span class="sig-paren">)</span><a class="headerlink" href="#core.directories.Directories.load_from_file" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Load folder selection from <code class="docutils literal notranslate"><span class="pre">infile</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>infile</strong> (<em>file</em>) – path or file pointer to XML generated through <a class="reference internal" href="#core.directories.Directories.save_to_file" title="core.directories.Directories.save_to_file"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_to_file()</span></code></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.directories.Directories.save_to_file">
|
||||
<code class="descname">save_to_file</code><span class="sig-paren">(</span><em>outfile</em><span class="sig-paren">)</span><a class="headerlink" href="#core.directories.Directories.save_to_file" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Save folder selection as XML to <code class="docutils literal notranslate"><span class="pre">outfile</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>outfile</strong> (<em>file</em>) – path or file pointer to XML file to save to.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.directories.Directories.set_state">
|
||||
<code class="descname">set_state</code><span class="sig-paren">(</span><em>path</em>, <em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#core.directories.Directories.set_state" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set the state of folder at <code class="docutils literal notranslate"><span class="pre">path</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>path</strong> (<a class="reference internal" href="../hscommon/path.html#hscommon.path.Path" title="hscommon.path.Path"><em>Path</em></a>) – path of the target folder</li>
|
||||
<li><strong>state</strong> (<a class="reference internal" href="#core.directories.DirectoryState" title="core.directories.DirectoryState"><code class="xref py py-class docutils literal notranslate"><span class="pre">DirectoryState</span></code></a>) – state to set folder to</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="core.directories.DirectoryState">
|
||||
<em class="property">class </em><code class="descclassname">core.directories.</code><code class="descname">DirectoryState</code><a class="headerlink" href="#core.directories.DirectoryState" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Enum describing how a folder should be considered.</p>
|
||||
<ul class="simple">
|
||||
<li>DirectoryState.Normal: Scan all files normally</li>
|
||||
<li>DirectoryState.Reference: Scan files, but make sure never to delete any of them</li>
|
||||
<li>DirectoryState.Excluded: Don’t scan this folder</li>
|
||||
</ul>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="engine.html">core.engine</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="results.html">core.results</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
284
help/en/developer/core/engine.html
Normal file
284
help/en/developer/core/engine.html
Normal file
@@ -0,0 +1,284 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>core.engine — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="core.directories" href="directories.html" />
|
||||
<link rel="prev" title="core.fs" href="fs.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>core.engine</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="fs.html">core.fs</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="directories.html">core.directories</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-core.engine">
|
||||
<span id="core-engine"></span><h1>core.engine<a class="headerlink" href="#module-core.engine" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="class">
|
||||
<dt id="core.engine.Match">
|
||||
<em class="property">class </em><code class="descclassname">core.engine.</code><code class="descname">Match</code><a class="headerlink" href="#core.engine.Match" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Represents a match between two <a class="reference internal" href="fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a>.</p>
|
||||
<p>Regarless of the matching method, when two files are determined to match, a Match pair is created,
|
||||
which holds, of course, the two matched files, but also their match “level”.</p>
|
||||
<dl class="attribute">
|
||||
<dt id="core.engine.Match.first">
|
||||
<code class="descname">first</code><a class="headerlink" href="#core.engine.Match.first" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>first file of the pair.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.engine.Match.second">
|
||||
<code class="descname">second</code><a class="headerlink" href="#core.engine.Match.second" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>second file of the pair.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.engine.Match.percentage">
|
||||
<code class="descname">percentage</code><a class="headerlink" href="#core.engine.Match.percentage" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>their match level according to the scan method which found the match. int from 1 to 100. For
|
||||
exact scan methods, such as Contents scans, this will always be 100.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="core.engine.Group">
|
||||
<em class="property">class </em><code class="descclassname">core.engine.</code><code class="descname">Group</code><a class="headerlink" href="#core.engine.Group" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A group of <a class="reference internal" href="fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> that match together.</p>
|
||||
<p>This manages match pairs into groups and ensures that all files in the group match to each
|
||||
other.</p>
|
||||
<dl class="attribute">
|
||||
<dt id="core.engine.Group.ref">
|
||||
<code class="descname">ref</code><a class="headerlink" href="#core.engine.Group.ref" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The “reference” file, which is the file among the group that isn’t going to be deleted.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.engine.Group.ordered">
|
||||
<code class="descname">ordered</code><a class="headerlink" href="#core.engine.Group.ordered" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Ordered list of duplicates in the group (including the <a class="reference internal" href="#core.engine.Group.ref" title="core.engine.Group.ref"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ref</span></code></a>).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.engine.Group.unordered">
|
||||
<code class="descname">unordered</code><a class="headerlink" href="#core.engine.Group.unordered" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set duplicates in the group (including the <a class="reference internal" href="#core.engine.Group.ref" title="core.engine.Group.ref"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ref</span></code></a>).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.engine.Group.dupes">
|
||||
<code class="descname">dupes</code><a class="headerlink" href="#core.engine.Group.dupes" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>An ordered list of the group’s duplicate, without <a class="reference internal" href="#core.engine.Group.ref" title="core.engine.Group.ref"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ref</span></code></a>. Equivalent to
|
||||
<code class="docutils literal notranslate"><span class="pre">ordered[1:]</span></code></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.engine.Group.percentage">
|
||||
<code class="descname">percentage</code><a class="headerlink" href="#core.engine.Group.percentage" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Average match percentage of match pairs containing <a class="reference internal" href="#core.engine.Group.ref" title="core.engine.Group.ref"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ref</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.engine.Group.add_match">
|
||||
<code class="descname">add_match</code><span class="sig-paren">(</span><em>match</em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.Group.add_match" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Adds <code class="docutils literal notranslate"><span class="pre">match</span></code> to internal match list and possibly add duplicates to the group.</p>
|
||||
<p>A duplicate can only be considered as such if it matches all other duplicates in the group.
|
||||
This method registers that pair (A, B) represented in <code class="docutils literal notranslate"><span class="pre">match</span></code> as possible candidates and,
|
||||
if A and/or B end up matching every other duplicates in the group, add these duplicates to
|
||||
the group.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>match</strong> (<em>tuple</em>) – pair of <a class="reference internal" href="fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> to add</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.engine.Group.discard_matches">
|
||||
<code class="descname">discard_matches</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.Group.discard_matches" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Remove all recorded matches that didn’t result in a duplicate being added to the group.</p>
|
||||
<p>You can call this after the duplicate scanning process to free a bit of memory.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.engine.Group.get_match_of">
|
||||
<code class="descname">get_match_of</code><span class="sig-paren">(</span><em>item</em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.Group.get_match_of" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the match pair between <code class="docutils literal notranslate"><span class="pre">item</span></code> and <a class="reference internal" href="#core.engine.Group.ref" title="core.engine.Group.ref"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ref</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.engine.Group.prioritize">
|
||||
<code class="descname">prioritize</code><span class="sig-paren">(</span><em>key_func</em>, <em>tie_breaker=None</em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.Group.prioritize" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Reorders <a class="reference internal" href="#core.engine.Group.ordered" title="core.engine.Group.ordered"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ordered</span></code></a> according to <code class="docutils literal notranslate"><span class="pre">key_func</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>key_func</strong> – Key (f(x)) to be used for sorting</li>
|
||||
<li><strong>tie_breaker</strong> – function to be used to select the reference position in case the top
|
||||
duplicates have the same key_func() result.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.engine.Group.switch_ref">
|
||||
<code class="descname">switch_ref</code><span class="sig-paren">(</span><em>with_dupe</em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.Group.switch_ref" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Make the <a class="reference internal" href="#core.engine.Group.ref" title="core.engine.Group.ref"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ref</span></code></a> dupe of the group switch position with <code class="docutils literal notranslate"><span class="pre">with_dupe</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.engine.build_word_dict">
|
||||
<code class="descclassname">core.engine.</code><code class="descname">build_word_dict</code><span class="sig-paren">(</span><em>objects</em>, <em>j=<hscommon.jobprogress.job.NullJob object></em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.build_word_dict" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a dict of objects mapped by their words.</p>
|
||||
<p>objects must have a <code class="docutils literal notranslate"><span class="pre">words</span></code> attribute being a list of strings or a list of lists of strings
|
||||
(<a class="reference internal" href="#fields"><span class="std std-ref">Fields</span></a>).</p>
|
||||
<p>The result will be a dict with words as keys, lists of objects as values.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.engine.compare">
|
||||
<code class="descclassname">core.engine.</code><code class="descname">compare</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>flags=()</em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.compare" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the % of words that match between <code class="docutils literal notranslate"><span class="pre">first</span></code> and <code class="docutils literal notranslate"><span class="pre">second</span></code></p>
|
||||
<p>The result is a <code class="docutils literal notranslate"><span class="pre">int</span></code> in the range 0..100.
|
||||
<code class="docutils literal notranslate"><span class="pre">first</span></code> and <code class="docutils literal notranslate"><span class="pre">second</span></code> can be either a string or a list (of words).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.engine.compare_fields">
|
||||
<code class="descclassname">core.engine.</code><code class="descname">compare_fields</code><span class="sig-paren">(</span><em>first</em>, <em>second</em>, <em>flags=()</em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.compare_fields" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the score for the lowest matching <a class="reference internal" href="#fields"><span class="std std-ref">Fields</span></a>.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">first</span></code> and <code class="docutils literal notranslate"><span class="pre">second</span></code> must be lists of lists of string. Each sub-list is then compared with
|
||||
<a class="reference internal" href="#core.engine.compare" title="core.engine.compare"><code class="xref py py-func docutils literal notranslate"><span class="pre">compare()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.engine.getmatches">
|
||||
<code class="descclassname">core.engine.</code><code class="descname">getmatches</code><span class="sig-paren">(</span><em>objects</em>, <em>min_match_percentage=0</em>, <em>match_similar_words=False</em>, <em>weight_words=False</em>, <em>no_field_order=False</em>, <em>j=<hscommon.jobprogress.job.NullJob object></em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.getmatches" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a list of <a class="reference internal" href="#core.engine.Match" title="core.engine.Match"><code class="xref py py-class docutils literal notranslate"><span class="pre">Match</span></code></a> within <code class="docutils literal notranslate"><span class="pre">objects</span></code> after fuzzily matching their words.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>objects</strong> – List of <a class="reference internal" href="fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> to match.</li>
|
||||
<li><strong>min_match_percentage</strong> (<em>int</em>) – minimum % of words that have to match.</li>
|
||||
<li><strong>match_similar_words</strong> (<em>bool</em>) – make similar words (see <a class="reference internal" href="#core.engine.merge_similar_words" title="core.engine.merge_similar_words"><code class="xref py py-func docutils literal notranslate"><span class="pre">merge_similar_words()</span></code></a>) match.</li>
|
||||
<li><strong>weight_words</strong> (<em>bool</em>) – longer words are worth more in match % computations.</li>
|
||||
<li><strong>no_field_order</strong> (<em>bool</em>) – match <a class="reference internal" href="#fields"><span class="std std-ref">Fields</span></a> regardless of their order.</li>
|
||||
<li><strong>j</strong> – A <a class="reference internal" href="../index.html#jobs"><span class="std std-ref">job progress instance</span></a>.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.engine.getmatches_by_contents">
|
||||
<code class="descclassname">core.engine.</code><code class="descname">getmatches_by_contents</code><span class="sig-paren">(</span><em>files</em>, <em>j=<hscommon.jobprogress.job.NullJob object></em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.getmatches_by_contents" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a list of <a class="reference internal" href="#core.engine.Match" title="core.engine.Match"><code class="xref py py-class docutils literal notranslate"><span class="pre">Match</span></code></a> within <code class="docutils literal notranslate"><span class="pre">files</span></code> if their contents is the same.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>j</strong> – A <a class="reference internal" href="../index.html#jobs"><span class="std std-ref">job progress instance</span></a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.engine.get_groups">
|
||||
<code class="descclassname">core.engine.</code><code class="descname">get_groups</code><span class="sig-paren">(</span><em>matches</em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.get_groups" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a list of <a class="reference internal" href="#core.engine.Group" title="core.engine.Group"><code class="xref py py-class docutils literal notranslate"><span class="pre">Group</span></code></a> from <code class="docutils literal notranslate"><span class="pre">matches</span></code>.</p>
|
||||
<p>Create groups out of match pairs in the smartest way possible.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.engine.merge_similar_words">
|
||||
<code class="descclassname">core.engine.</code><code class="descname">merge_similar_words</code><span class="sig-paren">(</span><em>word_dict</em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.merge_similar_words" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Take all keys in <code class="docutils literal notranslate"><span class="pre">word_dict</span></code> that are similar, and merge them together.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">word_dict</span></code> has been built with <a class="reference internal" href="#core.engine.build_word_dict" title="core.engine.build_word_dict"><code class="xref py py-func docutils literal notranslate"><span class="pre">build_word_dict()</span></code></a>. Similarity is computed with Python’s
|
||||
<code class="docutils literal notranslate"><span class="pre">difflib.get_close_matches()</span></code>, which computes the number of edits that are necessary to make
|
||||
a word equal to the other.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.engine.reduce_common_words">
|
||||
<code class="descclassname">core.engine.</code><code class="descname">reduce_common_words</code><span class="sig-paren">(</span><em>word_dict</em>, <em>threshold</em><span class="sig-paren">)</span><a class="headerlink" href="#core.engine.reduce_common_words" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Remove all objects from <code class="docutils literal notranslate"><span class="pre">word_dict</span></code> values where the object count >= <code class="docutils literal notranslate"><span class="pre">threshold</span></code></p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">word_dict</span></code> has been built with <a class="reference internal" href="#core.engine.build_word_dict" title="core.engine.build_word_dict"><code class="xref py py-func docutils literal notranslate"><span class="pre">build_word_dict()</span></code></a>.</p>
|
||||
<p>The exception to this removal are the objects where all the words of the object are common.
|
||||
Because if we remove them, we will miss some duplicates!</p>
|
||||
</dd></dl>
|
||||
|
||||
<div class="section" id="fields">
|
||||
<span id="id1"></span><h2>Fields<a class="headerlink" href="#fields" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Fields are groups of words which each represent a significant part of the whole name. This concept
|
||||
is sifnificant in music file names, where we often have names like “My Artist - a very long title
|
||||
with many many words”.</p>
|
||||
<p>This title has 10 words. If you run as scan with a bit of tolerance, let’s say 90%, you’ll be able
|
||||
to find a dupe that has only one “many” in the song title. However, you would also get false
|
||||
duplicates from a title like “My Giraffe - a very long title with many many words”, which is of
|
||||
course a very different song and it doesn’t make sense to match them.</p>
|
||||
<p>When matching by fields, each field (separated by “-“) is considered as a separate string to match
|
||||
independently. After all fields are matched, the lowest result is kept. In the “Giraffe” example we
|
||||
gave, the result would be 50% instead of 90% in normal mode.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="fs.html">core.fs</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="directories.html">core.directories</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
161
help/en/developer/core/fs.html
Normal file
161
help/en/developer/core/fs.html
Normal file
@@ -0,0 +1,161 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>core.fs — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="core.engine" href="engine.html" />
|
||||
<link rel="prev" title="core.app" href="app.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>core.fs</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="app.html">core.app</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="engine.html">core.engine</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-core.fs">
|
||||
<span id="core-fs"></span><h1>core.fs<a class="headerlink" href="#module-core.fs" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="exception">
|
||||
<dt id="core.fs.FSError">
|
||||
<em class="property">exception </em><code class="descclassname">core.fs.</code><code class="descname">FSError</code><span class="sig-paren">(</span><em>fsobject</em>, <em>parent=None</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.FSError" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="exception">
|
||||
<dt id="core.fs.AlreadyExistsError">
|
||||
<em class="property">exception </em><code class="descclassname">core.fs.</code><code class="descname">AlreadyExistsError</code><span class="sig-paren">(</span><em>fsobject</em>, <em>parent=None</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.AlreadyExistsError" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The directory or file name we’re trying to add already exists</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="exception">
|
||||
<dt id="core.fs.InvalidPath">
|
||||
<em class="property">exception </em><code class="descclassname">core.fs.</code><code class="descname">InvalidPath</code><span class="sig-paren">(</span><em>fsobject</em>, <em>parent=None</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.InvalidPath" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The path of self is invalid, and cannot be worked with.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="exception">
|
||||
<dt id="core.fs.InvalidDestinationError">
|
||||
<em class="property">exception </em><code class="descclassname">core.fs.</code><code class="descname">InvalidDestinationError</code><span class="sig-paren">(</span><em>fsobject</em>, <em>parent=None</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.InvalidDestinationError" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A copy/move operation has been called, but the destination is invalid.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="exception">
|
||||
<dt id="core.fs.OperationError">
|
||||
<em class="property">exception </em><code class="descclassname">core.fs.</code><code class="descname">OperationError</code><span class="sig-paren">(</span><em>fsobject</em>, <em>parent=None</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.OperationError" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A copy/move/delete operation has been called, but the checkup after the
|
||||
operation shows that it didn’t work.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="core.fs.File">
|
||||
<em class="property">class </em><code class="descclassname">core.fs.</code><code class="descname">File</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.File" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Represents a file and holds metadata to be used for scanning.</p>
|
||||
<dl class="classmethod">
|
||||
<dt id="core.fs.File.can_handle">
|
||||
<em class="property">classmethod </em><code class="descname">can_handle</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.File.can_handle" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns whether this file wrapper class can handle <code class="docutils literal notranslate"><span class="pre">path</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.fs.File.get_display_info">
|
||||
<code class="descname">get_display_info</code><span class="sig-paren">(</span><em>group</em>, <em>delta</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.File.get_display_info" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a display-ready dict of dupe’s data.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="core.fs.Folder">
|
||||
<em class="property">class </em><code class="descclassname">core.fs.</code><code class="descname">Folder</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.Folder" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A wrapper around a folder path.</p>
|
||||
<p>It has the size/md5 info of a File, but it’s value are the sum of its subitems.</p>
|
||||
<dl class="classmethod">
|
||||
<dt id="core.fs.Folder.can_handle">
|
||||
<em class="property">classmethod </em><code class="descname">can_handle</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.Folder.can_handle" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns whether this file wrapper class can handle <code class="docutils literal notranslate"><span class="pre">path</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.fs.get_file">
|
||||
<code class="descclassname">core.fs.</code><code class="descname">get_file</code><span class="sig-paren">(</span><em>path, fileclasses=[<class 'core.fs.File'>]</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.get_file" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Wraps <code class="docutils literal notranslate"><span class="pre">path</span></code> around its appropriate <a class="reference internal" href="#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> class.</p>
|
||||
<p>Whether a class is “appropriate” is decided by <a class="reference internal" href="#core.fs.File.can_handle" title="core.fs.File.can_handle"><code class="xref py py-meth docutils literal notranslate"><span class="pre">File.can_handle()</span></code></a></p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>path</strong> (<a class="reference internal" href="../hscommon/path.html#hscommon.path.Path" title="hscommon.path.Path"><em>Path</em></a>) – path to wrap</li>
|
||||
<li><strong>fileclasses</strong> – List of candidate <a class="reference internal" href="#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> classes</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="core.fs.get_files">
|
||||
<code class="descclassname">core.fs.</code><code class="descname">get_files</code><span class="sig-paren">(</span><em>path, fileclasses=[<class 'core.fs.File'>]</em><span class="sig-paren">)</span><a class="headerlink" href="#core.fs.get_files" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a list of <a class="reference internal" href="#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> for each file contained in <code class="docutils literal notranslate"><span class="pre">path</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>path</strong> (<a class="reference internal" href="../hscommon/path.html#hscommon.path.Path" title="hscommon.path.Path"><em>Path</em></a>) – path to scan</li>
|
||||
<li><strong>fileclasses</strong> – List of candidate <a class="reference internal" href="#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> classes</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="app.html">core.app</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="engine.html">core.engine</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
151
help/en/developer/core/gui/deletion_options.html
Normal file
151
help/en/developer/core/gui/deletion_options.html
Normal file
@@ -0,0 +1,151 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>core.gui.deletion_options — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon" href="../../hscommon/index.html" />
|
||||
<link rel="prev" title="core.gui" href="index.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>core.gui.deletion_options</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="index.html">core.gui</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="../../hscommon/index.html">hscommon</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-core.gui.deletion_options">
|
||||
<span id="core-gui-deletion-options"></span><h1>core.gui.deletion_options<a class="headerlink" href="#module-core.gui.deletion_options" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="class">
|
||||
<dt id="core.gui.deletion_options.DeletionOptions">
|
||||
<em class="property">class </em><code class="descclassname">core.gui.deletion_options.</code><code class="descname">DeletionOptions</code><a class="headerlink" href="#core.gui.deletion_options.DeletionOptions" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Present the user with deletion options before proceeding.</p>
|
||||
<p>When the user activates “Send to trash”, we present him with a couple of options that changes
|
||||
the behavior of that deletion operation.</p>
|
||||
<dl class="method">
|
||||
<dt id="core.gui.deletion_options.DeletionOptions.show">
|
||||
<code class="descname">show</code><span class="sig-paren">(</span><em>mark_count</em><span class="sig-paren">)</span><a class="headerlink" href="#core.gui.deletion_options.DeletionOptions.show" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Prompt the user with a modal dialog offering our deletion options.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>mark_count</strong> (<em>int</em>) – Number of dupes marked for deletion.</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Whether the user accepted the dialog (we cancel deletion if false).</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.gui.deletion_options.DeletionOptions.supports_links">
|
||||
<code class="descname">supports_links</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.gui.deletion_options.DeletionOptions.supports_links" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns whether our platform supports symlinks.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.gui.deletion_options.DeletionOptions.direct">
|
||||
<code class="descname">direct</code><em class="property"> = None</em><a class="headerlink" href="#core.gui.deletion_options.DeletionOptions.direct" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Delete dupes directly and don’t send to trash.
|
||||
<em>bool</em>. <em>get/set</em></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.gui.deletion_options.DeletionOptions.link_deleted">
|
||||
<code class="descname">link_deleted</code><a class="headerlink" href="#core.gui.deletion_options.DeletionOptions.link_deleted" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Replace deleted dupes with symlinks (or hardlinks) to the dupe group reference.</p>
|
||||
<p><em>bool</em>. <em>get/set</em></p>
|
||||
<p>Whether the link is a symlink or hardlink is decided by <a class="reference internal" href="#core.gui.deletion_options.DeletionOptions.use_hardlinks" title="core.gui.deletion_options.DeletionOptions.use_hardlinks"><code class="xref py py-attr docutils literal notranslate"><span class="pre">use_hardlinks</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.gui.deletion_options.DeletionOptions.use_hardlinks">
|
||||
<code class="descname">use_hardlinks</code><em class="property"> = None</em><a class="headerlink" href="#core.gui.deletion_options.DeletionOptions.use_hardlinks" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Whether symlinks or hardlinks are used when doing <a class="reference internal" href="#core.gui.deletion_options.DeletionOptions.link_deleted" title="core.gui.deletion_options.DeletionOptions.link_deleted"><code class="xref py py-attr docutils literal notranslate"><span class="pre">link_deleted</span></code></a>.
|
||||
<em>bool</em>. <em>get/set</em></p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="core.gui.deletion_options.DeletionOptionsView">
|
||||
<em class="property">class </em><code class="descclassname">core.gui.deletion_options.</code><code class="descname">DeletionOptionsView</code><a class="headerlink" href="#core.gui.deletion_options.DeletionOptionsView" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Expected interface for <a class="reference internal" href="#core.gui.deletion_options.DeletionOptions" title="core.gui.deletion_options.DeletionOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">DeletionOptions</span></code></a>’s view.</p>
|
||||
<p><em>Not actually used in the code. For documentation purposes only.</em></p>
|
||||
<p>Our view presents the user with an appropriate way (probably a mix of checkboxes and radio
|
||||
buttons) to set the different flags in <a class="reference internal" href="#core.gui.deletion_options.DeletionOptions" title="core.gui.deletion_options.DeletionOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">DeletionOptions</span></code></a>. Note that
|
||||
<a class="reference internal" href="#core.gui.deletion_options.DeletionOptions.use_hardlinks" title="core.gui.deletion_options.DeletionOptions.use_hardlinks"><code class="xref py py-attr docutils literal notranslate"><span class="pre">DeletionOptions.use_hardlinks</span></code></a> is only relevant if <a class="reference internal" href="#core.gui.deletion_options.DeletionOptions.link_deleted" title="core.gui.deletion_options.DeletionOptions.link_deleted"><code class="xref py py-attr docutils literal notranslate"><span class="pre">DeletionOptions.link_deleted</span></code></a>
|
||||
is true. This is why we toggle the “enabled” state of that flag.</p>
|
||||
<p>We expect the view to set <a class="reference internal" href="#core.gui.deletion_options.DeletionOptions.link_deleted" title="core.gui.deletion_options.DeletionOptions.link_deleted"><code class="xref py py-attr docutils literal notranslate"><span class="pre">DeletionOptions.link_deleted</span></code></a> immediately as the user changes
|
||||
its value because it will toggle <a class="reference internal" href="#core.gui.deletion_options.DeletionOptionsView.set_hardlink_option_enabled" title="core.gui.deletion_options.DeletionOptionsView.set_hardlink_option_enabled"><code class="xref py py-meth docutils literal notranslate"><span class="pre">set_hardlink_option_enabled()</span></code></a></p>
|
||||
<p>Other than the flags, there’s also a prompt message which has a dynamic content, defined by
|
||||
<a class="reference internal" href="#core.gui.deletion_options.DeletionOptionsView.update_msg" title="core.gui.deletion_options.DeletionOptionsView.update_msg"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_msg()</span></code></a>.</p>
|
||||
<dl class="method">
|
||||
<dt id="core.gui.deletion_options.DeletionOptionsView.set_hardlink_option_enabled">
|
||||
<code class="descname">set_hardlink_option_enabled</code><span class="sig-paren">(</span><em>is_enabled: bool</em><span class="sig-paren">)</span><a class="headerlink" href="#core.gui.deletion_options.DeletionOptionsView.set_hardlink_option_enabled" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Enable or disable the widget controlling <a class="reference internal" href="#core.gui.deletion_options.DeletionOptions.use_hardlinks" title="core.gui.deletion_options.DeletionOptions.use_hardlinks"><code class="xref py py-attr docutils literal notranslate"><span class="pre">DeletionOptions.use_hardlinks</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.gui.deletion_options.DeletionOptionsView.show">
|
||||
<code class="descname">show</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.gui.deletion_options.DeletionOptionsView.show" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Show the dialog in a modal fashion.</p>
|
||||
<p>Returns whether the dialog was “accepted” (the user pressed OK).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.gui.deletion_options.DeletionOptionsView.update_msg">
|
||||
<code class="descname">update_msg</code><span class="sig-paren">(</span><em>msg: str</em><span class="sig-paren">)</span><a class="headerlink" href="#core.gui.deletion_options.DeletionOptionsView.update_msg" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Update the dialog’s prompt with <code class="docutils literal notranslate"><span class="pre">str</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="index.html">core.gui</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="../../hscommon/index.html">hscommon</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
78
help/en/developer/core/gui/index.html
Normal file
78
help/en/developer/core/gui/index.html
Normal file
@@ -0,0 +1,78 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>core.gui — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="core.gui.deletion_options" href="deletion_options.html" />
|
||||
<link rel="prev" title="core.results" href="../results.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>core.gui</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../results.html">core.results</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="deletion_options.html">core.gui.deletion_options</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-core.gui">
|
||||
<span id="core-gui"></span><h1>core.gui<a class="headerlink" href="#module-core.gui" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="meta-gui-elements-in-dupeguru">
|
||||
<h2>Meta GUI elements in dupeGuru<a class="headerlink" href="#meta-gui-elements-in-dupeguru" title="Permalink to this headline">¶</a></h2>
|
||||
<p>dupeGuru is designed with a <a class="reference external" href="http://www.hardcoded.net/articles/cross-toolkit-software">cross-toolkit</a> approach in mind. It means that its core code
|
||||
(which doesn’t depend on any GUI toolkit) has elements which preformat core information in a way
|
||||
that makes it easy for a UI layer to consume.</p>
|
||||
<p>For example, we have <code class="xref py py-class docutils literal notranslate"><span class="pre">ResultTable</span></code> which takes information from
|
||||
<a class="reference internal" href="../results.html#core.results.Results" title="core.results.Results"><code class="xref py py-class docutils literal notranslate"><span class="pre">Results</span></code></a> and mashes it in rows and columns which are ready to be fetched by
|
||||
either Cocoa’s <code class="docutils literal notranslate"><span class="pre">NSTableView</span></code> or Qt’s <code class="docutils literal notranslate"><span class="pre">QTableView</span></code>. It tells them which cell is supposed to be
|
||||
blue, which is supposed to be orange, does the sorting logic, holds selection, etc..</p>
|
||||
</div>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="deletion_options.html">core.gui.deletion_options</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../results.html">core.results</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="deletion_options.html">core.gui.deletion_options</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
80
help/en/developer/core/index.html
Normal file
80
help/en/developer/core/index.html
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>core — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="core.app" href="app.html" />
|
||||
<link rel="prev" title="Developer Guide" href="../index.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>core</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../index.html">Developer Guide</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="app.html">core.app</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="core">
|
||||
<h1>core<a class="headerlink" href="#core" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="app.html">core.app</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="fs.html">core.fs</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="engine.html">core.engine</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="engine.html#fields">Fields</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="directories.html">core.directories</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="results.html">core.results</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="gui/index.html">core.gui</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="gui/index.html#meta-gui-elements-in-dupeguru">Meta GUI elements in dupeGuru</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="gui/deletion_options.html">core.gui.deletion_options</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../index.html">Developer Guide</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="app.html">core.app</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
209
help/en/developer/core/results.html
Normal file
209
help/en/developer/core/results.html
Normal file
@@ -0,0 +1,209 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>core.results — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="core.gui" href="gui/index.html" />
|
||||
<link rel="prev" title="core.directories" href="directories.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>core.results</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="directories.html">core.directories</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="gui/index.html">core.gui</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-core.results">
|
||||
<span id="core-results"></span><h1>core.results<a class="headerlink" href="#module-core.results" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="class">
|
||||
<dt id="core.results.Results">
|
||||
<em class="property">class </em><code class="descclassname">core.results.</code><code class="descname">Results</code><span class="sig-paren">(</span><em>app</em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Manages a collection of duplicate <a class="reference internal" href="engine.html#core.engine.Group" title="core.engine.Group"><code class="xref py py-class docutils literal notranslate"><span class="pre">Group</span></code></a>.</p>
|
||||
<p>This class takes care or marking, sorting and filtering duplicate groups.</p>
|
||||
<dl class="attribute">
|
||||
<dt id="core.results.Results.groups">
|
||||
<code class="descname">groups</code><a class="headerlink" href="#core.results.Results.groups" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The list of <a class="reference internal" href="engine.html#core.engine.Group" title="core.engine.Group"><code class="xref py py-class docutils literal notranslate"><span class="pre">Group</span></code></a> contained managed by this instance.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="core.results.Results.dupes">
|
||||
<code class="descname">dupes</code><a class="headerlink" href="#core.results.Results.dupes" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A list of all duplicates (<a class="reference internal" href="fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> instances), without ref, contained in the
|
||||
currently managed <a class="reference internal" href="#core.results.Results.groups" title="core.results.Results.groups"><code class="xref py py-attr docutils literal notranslate"><span class="pre">groups</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.results.Results.apply_filter">
|
||||
<code class="descname">apply_filter</code><span class="sig-paren">(</span><em>filter_str</em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results.apply_filter" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Applies a filter <code class="docutils literal notranslate"><span class="pre">filter_str</span></code> to <a class="reference internal" href="#core.results.Results.groups" title="core.results.Results.groups"><code class="xref py py-attr docutils literal notranslate"><span class="pre">groups</span></code></a></p>
|
||||
<p>When you apply the filter, only dupes with the filename matching <code class="docutils literal notranslate"><span class="pre">filter_str</span></code> will be in
|
||||
in the results. To cancel the filter, just call apply_filter with <code class="docutils literal notranslate"><span class="pre">filter_str</span></code> to None,
|
||||
and the results will go back to normal.</p>
|
||||
<p>If call apply_filter on a filtered results, the filter will be applied
|
||||
<em>on the filtered results</em>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filter_str</strong> (<em>str</em>) – a string containing a regexp to filter dupes with.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.results.Results.get_group_of_duplicate">
|
||||
<code class="descname">get_group_of_duplicate</code><span class="sig-paren">(</span><em>dupe</em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results.get_group_of_duplicate" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns <a class="reference internal" href="engine.html#core.engine.Group" title="core.engine.Group"><code class="xref py py-class docutils literal notranslate"><span class="pre">Group</span></code></a> in which <code class="docutils literal notranslate"><span class="pre">dupe</span></code> belongs.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.results.Results.load_from_xml">
|
||||
<code class="descname">load_from_xml</code><span class="sig-paren">(</span><em>infile</em>, <em>get_file</em>, <em>j=<hscommon.jobprogress.job.NullJob object></em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results.load_from_xml" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Load results from <code class="docutils literal notranslate"><span class="pre">infile</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>infile</strong> – a file or path pointing to an XML file created with <a class="reference internal" href="#core.results.Results.save_to_xml" title="core.results.Results.save_to_xml"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_to_xml()</span></code></a>.</li>
|
||||
<li><strong>get_file</strong> – a function f(path) returning a <a class="reference internal" href="fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> wrapping the path.</li>
|
||||
<li><strong>j</strong> – A <a class="reference internal" href="../index.html#jobs"><span class="std std-ref">job progress instance</span></a>.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.results.Results.make_ref">
|
||||
<code class="descname">make_ref</code><span class="sig-paren">(</span><em>dupe</em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results.make_ref" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Make <code class="docutils literal notranslate"><span class="pre">dupe</span></code> take the <a class="reference internal" href="engine.html#core.engine.Group.ref" title="core.engine.Group.ref"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ref</span></code></a> position of its group.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.results.Results.perform_on_marked">
|
||||
<code class="descname">perform_on_marked</code><span class="sig-paren">(</span><em>func</em>, <em>remove_from_results</em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results.perform_on_marked" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Performs <code class="docutils literal notranslate"><span class="pre">func</span></code> on all marked dupes.</p>
|
||||
<p>If an <code class="docutils literal notranslate"><span class="pre">EnvironmentError</span></code> is raised during the call, the problematic dupe is added to
|
||||
self.problems.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>remove_from_results</strong> (<em>bool</em>) – If true, dupes which had <code class="docutils literal notranslate"><span class="pre">func</span></code> applied and didn’t cause
|
||||
any problem.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.results.Results.remove_duplicates">
|
||||
<code class="descname">remove_duplicates</code><span class="sig-paren">(</span><em>dupes</em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results.remove_duplicates" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Remove <code class="docutils literal notranslate"><span class="pre">dupes</span></code> from their respective <a class="reference internal" href="engine.html#core.engine.Group" title="core.engine.Group"><code class="xref py py-class docutils literal notranslate"><span class="pre">Group</span></code></a>.</p>
|
||||
<p>Also, remove the group from <a class="reference internal" href="#core.results.Results.groups" title="core.results.Results.groups"><code class="xref py py-attr docutils literal notranslate"><span class="pre">groups</span></code></a> if it ends up empty.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.results.Results.save_to_xml">
|
||||
<code class="descname">save_to_xml</code><span class="sig-paren">(</span><em>outfile</em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results.save_to_xml" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Save results to <code class="docutils literal notranslate"><span class="pre">outfile</span></code> in XML.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>outfile</strong> – file object or path.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.results.Results.sort_dupes">
|
||||
<code class="descname">sort_dupes</code><span class="sig-paren">(</span><em>key</em>, <em>asc=True</em>, <em>delta=False</em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results.sort_dupes" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Sort <a class="reference internal" href="#core.results.Results.dupes" title="core.results.Results.dupes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">dupes</span></code></a> according to <code class="docutils literal notranslate"><span class="pre">key</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>key</strong> (<em>str</em>) – key attribute name to sort with.</li>
|
||||
<li><strong>asc</strong> (<em>bool</em>) – If false, sorting is reversed.</li>
|
||||
<li><strong>delta</strong> (<em>bool</em>) – If true, sorting occurs using <a class="reference internal" href="../../results.html#deltavalues"><span class="std std-ref">delta values</span></a>.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="core.results.Results.sort_groups">
|
||||
<code class="descname">sort_groups</code><span class="sig-paren">(</span><em>key</em>, <em>asc=True</em><span class="sig-paren">)</span><a class="headerlink" href="#core.results.Results.sort_groups" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Sort <a class="reference internal" href="#core.results.Results.groups" title="core.results.Results.groups"><code class="xref py py-attr docutils literal notranslate"><span class="pre">groups</span></code></a> according to <code class="docutils literal notranslate"><span class="pre">key</span></code>.</p>
|
||||
<p>The <a class="reference internal" href="engine.html#core.engine.Group.ref" title="core.engine.Group.ref"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ref</span></code></a> of each group is used to extract values for sorting.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>key</strong> (<em>str</em>) – key attribute name to sort with.</li>
|
||||
<li><strong>asc</strong> (<em>bool</em>) – If false, sorting is reversed.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="directories.html">core.directories</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="gui/index.html">core.gui</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
112
help/en/developer/hscommon/build.html
Normal file
112
help/en/developer/hscommon/build.html
Normal file
@@ -0,0 +1,112 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.build — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="hscommon.conflict" href="conflict.html" />
|
||||
<link rel="prev" title="hscommon" href="index.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.build</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="index.html">hscommon</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="conflict.html">hscommon.conflict</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.build">
|
||||
<span id="hscommon-build"></span><h1>hscommon.build<a class="headerlink" href="#module-hscommon.build" title="Permalink to this headline">¶</a></h1>
|
||||
<p>This module is a collection of function to help in HS apps build process.</p>
|
||||
<dl class="function">
|
||||
<dt id="hscommon.build.add_to_pythonpath">
|
||||
<code class="descclassname">hscommon.build.</code><code class="descname">add_to_pythonpath</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.build.add_to_pythonpath" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Adds <code class="docutils literal notranslate"><span class="pre">path</span></code> to both <code class="docutils literal notranslate"><span class="pre">PYTHONPATH</span></code> env and <code class="docutils literal notranslate"><span class="pre">sys.path</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.build.build_debian_changelog">
|
||||
<code class="descclassname">hscommon.build.</code><code class="descname">build_debian_changelog</code><span class="sig-paren">(</span><em>changelogpath</em>, <em>destfile</em>, <em>pkgname</em>, <em>from_version=None</em>, <em>distribution='precise'</em>, <em>fix_version=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.build.build_debian_changelog" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Builds a debian changelog out of a YAML changelog.</p>
|
||||
<p>Use fix_version to patch the top changelog to that version (if, for example, there was a
|
||||
packaging error and you need to quickly fix it)</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.build.build_dmg">
|
||||
<code class="descclassname">hscommon.build.</code><code class="descname">build_dmg</code><span class="sig-paren">(</span><em>app_path</em>, <em>destfolder</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.build.build_dmg" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Builds a DMG volume with application at <code class="docutils literal notranslate"><span class="pre">app_path</span></code> and puts it in <code class="docutils literal notranslate"><span class="pre">dest_path</span></code>.</p>
|
||||
<p>The name of the resulting DMG volume is determined by the app’s name and version.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.build.copy_packages">
|
||||
<code class="descclassname">hscommon.build.</code><code class="descname">copy_packages</code><span class="sig-paren">(</span><em>packages_names</em>, <em>dest</em>, <em>create_links=False</em>, <em>extra_ignores=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.build.copy_packages" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Copy python packages <code class="docutils literal notranslate"><span class="pre">packages_names</span></code> to <code class="docutils literal notranslate"><span class="pre">dest</span></code>, spurious data.</p>
|
||||
<p>Copy will happen without tests, testdata, mercurial data or C extension module source with it.
|
||||
<code class="docutils literal notranslate"><span class="pre">py2app</span></code> include and exclude rules are <strong>quite</strong> funky, and doing this is the only reliable
|
||||
way to make sure we don’t end up with useless stuff in our app.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.build.ensure_empty_folder">
|
||||
<code class="descclassname">hscommon.build.</code><code class="descname">ensure_empty_folder</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.build.ensure_empty_folder" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Make sure that the path exists and that it’s an empty folder.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.build.filereplace">
|
||||
<code class="descclassname">hscommon.build.</code><code class="descname">filereplace</code><span class="sig-paren">(</span><em>filename</em>, <em>outfilename=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.build.filereplace" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Reads <cite>filename</cite>, replaces all {variables} in kwargs, and writes the result to <cite>outfilename</cite>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.build.print_and_do">
|
||||
<code class="descclassname">hscommon.build.</code><code class="descname">print_and_do</code><span class="sig-paren">(</span><em>cmd</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.build.print_and_do" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Prints <code class="docutils literal notranslate"><span class="pre">cmd</span></code> and executes it in the shell.</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="index.html">hscommon</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="conflict.html">hscommon.conflict</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
98
help/en/developer/hscommon/conflict.html
Normal file
98
help/en/developer/hscommon/conflict.html
Normal file
@@ -0,0 +1,98 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.conflict — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="hscommon.desktop" href="desktop.html" />
|
||||
<link rel="prev" title="hscommon.build" href="build.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.conflict</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="build.html">hscommon.build</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="desktop.html">hscommon.desktop</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.conflict">
|
||||
<span id="hscommon-conflict"></span><h1>hscommon.conflict<a class="headerlink" href="#module-hscommon.conflict" title="Permalink to this headline">¶</a></h1>
|
||||
<p>When you have to deal with names that have to be unique and can conflict together, you can use
|
||||
this module that deals with conflicts by prepending unique numbers in <code class="docutils literal notranslate"><span class="pre">[]</span></code> brackets to the name.</p>
|
||||
<dl class="function">
|
||||
<dt id="hscommon.conflict.get_conflicted_name">
|
||||
<code class="descclassname">hscommon.conflict.</code><code class="descname">get_conflicted_name</code><span class="sig-paren">(</span><em>other_names</em>, <em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.conflict.get_conflicted_name" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns name with a <code class="docutils literal notranslate"><span class="pre">[000]</span></code> number in front of it.</p>
|
||||
<p>The number between brackets depends on how many conlicted filenames
|
||||
there already are in other_names.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.conflict.get_unconflicted_name">
|
||||
<code class="descclassname">hscommon.conflict.</code><code class="descname">get_unconflicted_name</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.conflict.get_unconflicted_name" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">name</span></code> without <code class="docutils literal notranslate"><span class="pre">[]</span></code> brackets.</p>
|
||||
<p>Brackets which, of course, might have been added by func:<cite>get_conflicted_name</cite>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.conflict.is_conflicted">
|
||||
<code class="descclassname">hscommon.conflict.</code><code class="descname">is_conflicted</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.conflict.is_conflicted" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns whether <code class="docutils literal notranslate"><span class="pre">name</span></code> is prepended with a bracketed number.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.conflict.smart_copy">
|
||||
<code class="descclassname">hscommon.conflict.</code><code class="descname">smart_copy</code><span class="sig-paren">(</span><em>source_path</em>, <em>dest_path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.conflict.smart_copy" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Copies <code class="docutils literal notranslate"><span class="pre">source_path</span></code> to <code class="docutils literal notranslate"><span class="pre">dest_path</span></code>, recursively and with conflict resolution.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.conflict.smart_move">
|
||||
<code class="descclassname">hscommon.conflict.</code><code class="descname">smart_move</code><span class="sig-paren">(</span><em>source_path</em>, <em>dest_path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.conflict.smart_move" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Same as <a class="reference internal" href="#hscommon.conflict.smart_copy" title="hscommon.conflict.smart_copy"><code class="xref py py-func docutils literal notranslate"><span class="pre">smart_copy()</span></code></a>, but it moves files instead.</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="build.html">hscommon.build</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="desktop.html">hscommon.desktop</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
90
help/en/developer/hscommon/desktop.html
Normal file
90
help/en/developer/hscommon/desktop.html
Normal file
@@ -0,0 +1,90 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.desktop — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="hscommon.notify" href="notify.html" />
|
||||
<link rel="prev" title="hscommon.conflict" href="conflict.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.desktop</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="conflict.html">hscommon.conflict</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="notify.html">hscommon.notify</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.desktop">
|
||||
<span id="hscommon-desktop"></span><h1>hscommon.desktop<a class="headerlink" href="#module-hscommon.desktop" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="function">
|
||||
<dt id="hscommon.desktop.open_path">
|
||||
<code class="descclassname">hscommon.desktop.</code><code class="descname">open_path</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.desktop.open_path" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Open <code class="docutils literal notranslate"><span class="pre">path</span></code> with its associated application.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.desktop.open_url">
|
||||
<code class="descclassname">hscommon.desktop.</code><code class="descname">open_url</code><span class="sig-paren">(</span><em>url</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.desktop.open_url" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Open <code class="docutils literal notranslate"><span class="pre">url</span></code> with the default browser.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.desktop.reveal_path">
|
||||
<code class="descclassname">hscommon.desktop.</code><code class="descname">reveal_path</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.desktop.reveal_path" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Open the folder containing <code class="docutils literal notranslate"><span class="pre">path</span></code> with the default file browser.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.desktop.special_folder_path">
|
||||
<code class="descclassname">hscommon.desktop.</code><code class="descname">special_folder_path</code><span class="sig-paren">(</span><em>special_folder</em>, <em>appname=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.desktop.special_folder_path" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the path of <code class="docutils literal notranslate"><span class="pre">special_folder</span></code>.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">special_folder</span></code> is a SpecialFolder.* const. The result is the special folder for the current
|
||||
application. The running process’ application info is used to determine relevant information.</p>
|
||||
<p>You can override the application name with <code class="docutils literal notranslate"><span class="pre">appname</span></code>. This argument is ingored under Qt.</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="conflict.html">hscommon.conflict</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="notify.html">hscommon.notify</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
116
help/en/developer/hscommon/gui/base.html
Normal file
116
help/en/developer/hscommon/gui/base.html
Normal file
@@ -0,0 +1,116 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.gui.base — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon.gui.column" href="column.html" />
|
||||
<link rel="prev" title="hscommon.jobprogress.qt" href="../jobprogress/qt.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.gui.base</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../jobprogress/qt.html">hscommon.jobprogress.qt</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="column.html">hscommon.gui.column</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.gui.base">
|
||||
<span id="hscommon-gui-base"></span><h1>hscommon.gui.base<a class="headerlink" href="#module-hscommon.gui.base" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.base.GUIObject" title="hscommon.gui.base.GUIObject"><code class="xref py py-obj docutils literal notranslate"><span class="pre">GUIObject</span></code></a>([multibind])</td>
|
||||
<td>Cross-toolkit “model” representation of a GUI layer object.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.base.GUIObject">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.base.</code><code class="descname">GUIObject</code><span class="sig-paren">(</span><em>multibind=False</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.base.GUIObject" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Cross-toolkit “model” representation of a GUI layer object.</p>
|
||||
<p>A <code class="docutils literal notranslate"><span class="pre">GUIObject</span></code> is a cross-toolkit “model” representation of a GUI layer object, for example, a
|
||||
table. It acts as a cross-toolkit interface to what we call here a <a class="reference internal" href="#hscommon.gui.base.GUIObject.view" title="hscommon.gui.base.GUIObject.view"><code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code></a>. That
|
||||
view is a toolkit-specific controller to the actual view (an <code class="docutils literal notranslate"><span class="pre">NSTableView</span></code>, a <code class="docutils literal notranslate"><span class="pre">QTableView</span></code>,
|
||||
etc.). In our GUIObject, we need a reference to that toolkit-specific controller because some
|
||||
actions have effects on it (for example, prompting it to refresh its data). The <code class="docutils literal notranslate"><span class="pre">GUIObject</span></code>
|
||||
is typically instantiated before its <a class="reference internal" href="#hscommon.gui.base.GUIObject.view" title="hscommon.gui.base.GUIObject.view"><code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code></a>, that is why we set it to <code class="docutils literal notranslate"><span class="pre">None</span></code> on init.
|
||||
However, the GUI layer is supposed to set the view as soon as its toolkit-specific controller is
|
||||
instantiated.</p>
|
||||
<p>When you subclass <code class="docutils literal notranslate"><span class="pre">GUIObject</span></code>, you will likely want to update its view on instantiation. That
|
||||
is why we call <code class="docutils literal notranslate"><span class="pre">self.view.refresh()</span></code> in <a class="reference internal" href="#hscommon.gui.base.GUIObject._view_updated" title="hscommon.gui.base.GUIObject._view_updated"><code class="xref py py-meth docutils literal notranslate"><span class="pre">_view_updated()</span></code></a>. If you need another type of
|
||||
action on view instantiation, just override the method.</p>
|
||||
<p>Most of the time, you will only one to bind a view once in the lifetime of your GUI object.
|
||||
That is why there are safeguards, when setting <code class="docutils literal notranslate"><span class="pre">view</span></code> to ensure that we don’t double-assign.
|
||||
However, sometimes you want to be able to re-bind another view. In this case, set the
|
||||
<code class="docutils literal notranslate"><span class="pre">multibind</span></code> flag to <code class="docutils literal notranslate"><span class="pre">True</span></code> and the safeguard will be disabled.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.base.GUIObject._view_updated">
|
||||
<code class="descname">_view_updated</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.base.GUIObject._view_updated" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Called after <a class="reference internal" href="#hscommon.gui.base.GUIObject.view" title="hscommon.gui.base.GUIObject.view"><code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code></a> has been set.</p>
|
||||
<p>Doing nothing by default, this method is called after <a class="reference internal" href="#hscommon.gui.base.GUIObject.view" title="hscommon.gui.base.GUIObject.view"><code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code></a> has been set (it isn’t
|
||||
called when it’s unset, however). Use this for initialization code that requires a view
|
||||
(which is often the whole of the initialization code).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.base.GUIObject.view">
|
||||
<code class="descname">view</code><a class="headerlink" href="#hscommon.gui.base.GUIObject.view" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A reference to our toolkit-specific view controller.</p>
|
||||
<p><em>view answering to GUIObject sublass’s view protocol</em>. <em>get/set</em></p>
|
||||
<p>This view starts as <code class="docutils literal notranslate"><span class="pre">None</span></code> and has to be set “manually”. There’s two times at which we set
|
||||
the view property: On initialization, where we set the view that we’ll use for our lifetime,
|
||||
and just before the view is deallocated. We need to unset our view at that time to avoid
|
||||
calls to a deallocated instance (which means a crash).</p>
|
||||
<p>To unset our view, we simple assign it to <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../jobprogress/qt.html">hscommon.jobprogress.qt</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="column.html">hscommon.gui.column</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
367
help/en/developer/hscommon/gui/column.html
Normal file
367
help/en/developer/hscommon/gui/column.html
Normal file
@@ -0,0 +1,367 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.gui.column — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon.gui.progress_window" href="progress_window.html" />
|
||||
<link rel="prev" title="hscommon.gui.base" href="base.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.gui.column</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="base.html">hscommon.gui.base</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="progress_window.html">hscommon.gui.progress_window</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.gui.column">
|
||||
<span id="hscommon-gui-column"></span><h1>hscommon.gui.column<a class="headerlink" href="#module-hscommon.gui.column" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.column.Columns" title="hscommon.gui.column.Columns"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Columns</span></code></a>(table[, prefaccess, savename])</td>
|
||||
<td>Cross-toolkit GUI-enabled column set for tables or outlines.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.gui.column.Column" title="hscommon.gui.column.Column"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Column</span></code></a>(name[, display, visible, optional])</td>
|
||||
<td>Holds column attributes such as its name, width, visibility, etc.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.column.ColumnsView" title="hscommon.gui.column.ColumnsView"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ColumnsView</span></code></a></td>
|
||||
<td>Expected interface for <a class="reference internal" href="#hscommon.gui.column.Columns" title="hscommon.gui.column.Columns"><code class="xref py py-class docutils literal notranslate"><span class="pre">Columns</span></code></a>’s view.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.gui.column.PrefAccessInterface" title="hscommon.gui.column.PrefAccessInterface"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PrefAccessInterface</span></code></a></td>
|
||||
<td>Expected interface for <a class="reference internal" href="#hscommon.gui.column.Columns" title="hscommon.gui.column.Columns"><code class="xref py py-class docutils literal notranslate"><span class="pre">Columns</span></code></a>’s prefaccess.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.column.Columns">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.column.</code><code class="descname">Columns</code><span class="sig-paren">(</span><em>table</em>, <em>prefaccess=None</em>, <em>savename=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Cross-toolkit GUI-enabled column set for tables or outlines.</p>
|
||||
<p>Manages a column set’s order, visibility and width. We also manage the persistence of these
|
||||
attributes so that we can restore them on the next run.</p>
|
||||
<p>Subclasses <a class="reference internal" href="base.html#hscommon.gui.base.GUIObject" title="hscommon.gui.base.GUIObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUIObject</span></code></a>. Expected view: <a class="reference internal" href="#hscommon.gui.column.ColumnsView" title="hscommon.gui.column.ColumnsView"><code class="xref py py-class docutils literal notranslate"><span class="pre">ColumnsView</span></code></a>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>table</strong> – The table the columns belong to. It’s from there that we retrieve our column
|
||||
configuration and it must have a <code class="docutils literal notranslate"><span class="pre">COLUMNS</span></code> attribute which is a list of
|
||||
<a class="reference internal" href="#hscommon.gui.column.Column" title="hscommon.gui.column.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a>. We also call <a class="reference internal" href="table.html#hscommon.gui.table.GUITable.save_edits" title="hscommon.gui.table.GUITable.save_edits"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_edits()</span></code></a> on it from time to
|
||||
time. Technically, this argument can also be a tree, but there’s probably some
|
||||
sorting in the code to do to support this option cleanly.</li>
|
||||
<li><strong>prefaccess</strong> – An object giving access to user preferences for the currently running app.
|
||||
We use this to make column attributes persistent. Must follow
|
||||
<a class="reference internal" href="#hscommon.gui.column.PrefAccessInterface" title="hscommon.gui.column.PrefAccessInterface"><code class="xref py py-class docutils literal notranslate"><span class="pre">PrefAccessInterface</span></code></a>.</li>
|
||||
<li><strong>savename</strong> (<em>str</em>) – The name under which column preferences will be saved. This name is in fact
|
||||
a prefix. Preferences are saved under more than one name, but they will all
|
||||
have that same prefix.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns._view_updated">
|
||||
<code class="descname">_view_updated</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns._view_updated" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Called after <code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code> has been set.</p>
|
||||
<p>Doing nothing by default, this method is called after <code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code> has been set (it isn’t
|
||||
called when it’s unset, however). Use this for initialization code that requires a view
|
||||
(which is often the whole of the initialization code).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.column_by_index">
|
||||
<code class="descname">column_by_index</code><span class="sig-paren">(</span><em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.column_by_index" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return the <a class="reference internal" href="#hscommon.gui.column.Column" title="hscommon.gui.column.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a> having the <a class="reference internal" href="#hscommon.gui.column.Column.logical_index" title="hscommon.gui.column.Column.logical_index"><code class="xref py py-attr docutils literal notranslate"><span class="pre">logical_index</span></code></a> <code class="docutils literal notranslate"><span class="pre">index</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.column_by_name">
|
||||
<code class="descname">column_by_name</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.column_by_name" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return the <a class="reference internal" href="#hscommon.gui.column.Column" title="hscommon.gui.column.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a> having the <a class="reference internal" href="#hscommon.gui.column.Column.name" title="hscommon.gui.column.Column.name"><code class="xref py py-attr docutils literal notranslate"><span class="pre">name</span></code></a> <code class="docutils literal notranslate"><span class="pre">name</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.column_display">
|
||||
<code class="descname">column_display</code><span class="sig-paren">(</span><em>colname</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.column_display" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns display name for column named <code class="docutils literal notranslate"><span class="pre">colname</span></code>, or <code class="docutils literal notranslate"><span class="pre">''</span></code> if there’s none.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.column_is_visible">
|
||||
<code class="descname">column_is_visible</code><span class="sig-paren">(</span><em>colname</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.column_is_visible" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns visibility for column named <code class="docutils literal notranslate"><span class="pre">colname</span></code>, or <code class="docutils literal notranslate"><span class="pre">True</span></code> if there’s none.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.column_width">
|
||||
<code class="descname">column_width</code><span class="sig-paren">(</span><em>colname</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.column_width" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns width for column named <code class="docutils literal notranslate"><span class="pre">colname</span></code>, or <code class="docutils literal notranslate"><span class="pre">0</span></code> if there’s none.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.columns_count">
|
||||
<code class="descname">columns_count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.columns_count" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the number of columns in our set.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.columns_to_right">
|
||||
<code class="descname">columns_to_right</code><span class="sig-paren">(</span><em>colname</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.columns_to_right" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the list of all columns to the right of <code class="docutils literal notranslate"><span class="pre">colname</span></code>.</p>
|
||||
<p>“right” meaning “having a higher <a class="reference internal" href="#hscommon.gui.column.Column.ordered_index" title="hscommon.gui.column.Column.ordered_index"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Column.ordered_index</span></code></a>” in our left-to-right
|
||||
civilization.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.menu_items">
|
||||
<code class="descname">menu_items</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.menu_items" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a list of items convenient for quick visibility menu generation.</p>
|
||||
<p>Returns a list of <code class="docutils literal notranslate"><span class="pre">(display_name,</span> <span class="pre">is_marked)</span></code> items for each optional column in the
|
||||
current view (<code class="docutils literal notranslate"><span class="pre">is_marked</span></code> means that it’s visible).</p>
|
||||
<p>You can use this to generate a menu to let the user toggle the visibility of an optional
|
||||
column. That is why we only show optional column, because the visibility of mandatory
|
||||
columns can’t be toggled.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.move_column">
|
||||
<code class="descname">move_column</code><span class="sig-paren">(</span><em>colname</em>, <em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.move_column" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Moves column <code class="docutils literal notranslate"><span class="pre">colname</span></code> to <code class="docutils literal notranslate"><span class="pre">index</span></code>.</p>
|
||||
<p>The column will be placed just in front of the column currently having that index, or to the
|
||||
end of the list if there’s none.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.reset_to_defaults">
|
||||
<code class="descname">reset_to_defaults</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.reset_to_defaults" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Reset all columns’ width and visibility to their default values.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.resize_column">
|
||||
<code class="descname">resize_column</code><span class="sig-paren">(</span><em>colname</em>, <em>newwidth</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.resize_column" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set column <code class="docutils literal notranslate"><span class="pre">colname</span></code>’s width to <code class="docutils literal notranslate"><span class="pre">newwidth</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.restore_columns">
|
||||
<code class="descname">restore_columns</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.restore_columns" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Restore’s column persistent attributes from the last <a class="reference internal" href="#hscommon.gui.column.Columns.save_columns" title="hscommon.gui.column.Columns.save_columns"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_columns()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.save_columns">
|
||||
<code class="descname">save_columns</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.save_columns" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Save column attributes in persistent storage for restoration in <a class="reference internal" href="#hscommon.gui.column.Columns.restore_columns" title="hscommon.gui.column.Columns.restore_columns"><code class="xref py py-meth docutils literal notranslate"><span class="pre">restore_columns()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.set_column_order">
|
||||
<code class="descname">set_column_order</code><span class="sig-paren">(</span><em>colnames</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.set_column_order" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Change the columns order so it matches the order in <code class="docutils literal notranslate"><span class="pre">colnames</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>colnames</strong> – A list of column names in the desired order.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.set_column_visible">
|
||||
<code class="descname">set_column_visible</code><span class="sig-paren">(</span><em>colname</em>, <em>visible</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.set_column_visible" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set the visibility of column <code class="docutils literal notranslate"><span class="pre">colname</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.set_default_width">
|
||||
<code class="descname">set_default_width</code><span class="sig-paren">(</span><em>colname</em>, <em>width</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.set_default_width" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set the default width or column <code class="docutils literal notranslate"><span class="pre">colname</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.Columns.toggle_menu_item">
|
||||
<code class="descname">toggle_menu_item</code><span class="sig-paren">(</span><em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Columns.toggle_menu_item" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Toggles the visibility of an optional column.</p>
|
||||
<p>You know, that optional column menu you’ve generated in <a class="reference internal" href="#hscommon.gui.column.Columns.menu_items" title="hscommon.gui.column.Columns.menu_items"><code class="xref py py-meth docutils literal notranslate"><span class="pre">menu_items()</span></code></a>? Well, <code class="docutils literal notranslate"><span class="pre">index</span></code>
|
||||
is the index of them menu item in <em>that</em> menu that the user has clicked on to toggle it.</p>
|
||||
<p>Returns whether the column in question ends up being visible or not.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Columns.colnames">
|
||||
<code class="descname">colnames</code><a class="headerlink" href="#hscommon.gui.column.Columns.colnames" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>List of column names in visible order.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Columns.ordered_columns">
|
||||
<code class="descname">ordered_columns</code><a class="headerlink" href="#hscommon.gui.column.Columns.ordered_columns" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>List of <a class="reference internal" href="#hscommon.gui.column.Column" title="hscommon.gui.column.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a> in visible order.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.column.Column">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.column.</code><code class="descname">Column</code><span class="sig-paren">(</span><em>name</em>, <em>display=''</em>, <em>visible=True</em>, <em>optional=False</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.Column" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Holds column attributes such as its name, width, visibility, etc.</p>
|
||||
<p>These attributes are then used to correctly configure the column on the “view” side.</p>
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Column.default_visible">
|
||||
<code class="descname">default_visible</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.column.Column.default_visible" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Whether the column is visible by default. It will be used if column restoration doesn’t
|
||||
contain any “remembered” widths.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Column.default_width">
|
||||
<code class="descname">default_width</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.column.Column.default_width" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Default width of the column. This value usually depends on the platform and is set on
|
||||
columns initialisation. It will be used if column restoration doesn’t contain any
|
||||
“remembered” widths.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Column.display">
|
||||
<code class="descname">display</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.column.Column.display" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Display name (title) of the column.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Column.logical_index">
|
||||
<code class="descname">logical_index</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.column.Column.logical_index" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Immutable index of the column. Doesn’t change even when columns are re-ordered. Used in
|
||||
<a class="reference internal" href="#hscommon.gui.column.Columns.column_by_index" title="hscommon.gui.column.Columns.column_by_index"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Columns.column_by_index()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Column.name">
|
||||
<code class="descname">name</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.column.Column.name" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>“programmatical” (not for display) name. Used as a reference in a couple of place, such
|
||||
as <a class="reference internal" href="#hscommon.gui.column.Columns.column_by_name" title="hscommon.gui.column.Columns.column_by_name"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Columns.column_by_name()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Column.optional">
|
||||
<code class="descname">optional</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.column.Column.optional" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Whether the column can have <a class="reference internal" href="#hscommon.gui.column.Column.visible" title="hscommon.gui.column.Column.visible"><code class="xref py py-attr docutils literal notranslate"><span class="pre">visible</span></code></a> set to false.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Column.ordered_index">
|
||||
<code class="descname">ordered_index</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.column.Column.ordered_index" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Index of the column in the ordered set of columns.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Column.visible">
|
||||
<code class="descname">visible</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.column.Column.visible" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Whether the column is visible.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.column.Column.width">
|
||||
<code class="descname">width</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.column.Column.width" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Width of the column.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.column.ColumnsView">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.column.</code><code class="descname">ColumnsView</code><a class="headerlink" href="#hscommon.gui.column.ColumnsView" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Expected interface for <a class="reference internal" href="#hscommon.gui.column.Columns" title="hscommon.gui.column.Columns"><code class="xref py py-class docutils literal notranslate"><span class="pre">Columns</span></code></a>’s view.</p>
|
||||
<p><em>Not actually used in the code. For documentation purposes only.</em></p>
|
||||
<p>Our view, the columns controller of a table or outline, is expected to properly respond to
|
||||
callbacks.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.ColumnsView.restore_columns">
|
||||
<code class="descname">restore_columns</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.ColumnsView.restore_columns" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Update all columns according to the model.</p>
|
||||
<p>When this is called, our view has to update the columns title, order and visibility of all
|
||||
columns.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.ColumnsView.set_column_visible">
|
||||
<code class="descname">set_column_visible</code><span class="sig-paren">(</span><em>colname</em>, <em>visible</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.ColumnsView.set_column_visible" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Update visibility of column <code class="docutils literal notranslate"><span class="pre">colname</span></code>.</p>
|
||||
<p>Called when the user toggles the visibility of a column, we must update the column
|
||||
<code class="docutils literal notranslate"><span class="pre">colname</span></code>’s visibility status to <code class="docutils literal notranslate"><span class="pre">visible</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.column.PrefAccessInterface">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.column.</code><code class="descname">PrefAccessInterface</code><a class="headerlink" href="#hscommon.gui.column.PrefAccessInterface" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Expected interface for <a class="reference internal" href="#hscommon.gui.column.Columns" title="hscommon.gui.column.Columns"><code class="xref py py-class docutils literal notranslate"><span class="pre">Columns</span></code></a>’s prefaccess.</p>
|
||||
<p><em>Not actually used in the code. For documentation purposes only.</em></p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.PrefAccessInterface.get_default">
|
||||
<code class="descname">get_default</code><span class="sig-paren">(</span><em>key</em>, <em>fallback_value</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.PrefAccessInterface.get_default" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Retrieve the value for <code class="docutils literal notranslate"><span class="pre">key</span></code> in the currently running app’s preference store.</p>
|
||||
<p>If the key doesn’t exist, return <code class="docutils literal notranslate"><span class="pre">fallback_value</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.column.PrefAccessInterface.set_default">
|
||||
<code class="descname">set_default</code><span class="sig-paren">(</span><em>key</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.column.PrefAccessInterface.set_default" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set the value <code class="docutils literal notranslate"><span class="pre">value</span></code> for <code class="docutils literal notranslate"><span class="pre">key</span></code> in the currently running app’s preference store.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="base.html">hscommon.gui.base</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="progress_window.html">hscommon.gui.progress_window</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
199
help/en/developer/hscommon/gui/progress_window.html
Normal file
199
help/en/developer/hscommon/gui/progress_window.html
Normal file
@@ -0,0 +1,199 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.gui.progress_window — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon.gui.selectable_list" href="selectable_list.html" />
|
||||
<link rel="prev" title="hscommon.gui.column" href="column.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.gui.progress_window</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="column.html">hscommon.gui.column</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="selectable_list.html">hscommon.gui.selectable_list</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.gui.progress_window">
|
||||
<span id="hscommon-gui-progress-window"></span><h1>hscommon.gui.progress_window<a class="headerlink" href="#module-hscommon.gui.progress_window" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindow" title="hscommon.gui.progress_window.ProgressWindow"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProgressWindow</span></code></a>(finish_func[, error_func])</td>
|
||||
<td>Cross-toolkit GUI-enabled progress window.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindowView" title="hscommon.gui.progress_window.ProgressWindowView"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ProgressWindowView</span></code></a></td>
|
||||
<td>Expected interface for <a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindow" title="hscommon.gui.progress_window.ProgressWindow"><code class="xref py py-class docutils literal notranslate"><span class="pre">ProgressWindow</span></code></a>’s view.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindow">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.progress_window.</code><code class="descname">ProgressWindow</code><span class="sig-paren">(</span><em>finish_func</em>, <em>error_func=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindow" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Cross-toolkit GUI-enabled progress window.</p>
|
||||
<p>This class allows you to run a long running, job enabled function in a separate thread and
|
||||
allow the user to follow its progress with a progress dialog.</p>
|
||||
<p>To use it, you start your long-running job with <a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindow.run" title="hscommon.gui.progress_window.ProgressWindow.run"><code class="xref py py-meth docutils literal notranslate"><span class="pre">run()</span></code></a> and then have your UI layer
|
||||
regularly call <a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindow.pulse" title="hscommon.gui.progress_window.ProgressWindow.pulse"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pulse()</span></code></a> to refresh the job status in the UI. It is advised that you call
|
||||
<a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindow.pulse" title="hscommon.gui.progress_window.ProgressWindow.pulse"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pulse()</span></code></a> in the main thread because GUI toolkit usually only support calling UI-related
|
||||
functions from the main thread.</p>
|
||||
<p>We subclass <a class="reference internal" href="base.html#hscommon.gui.base.GUIObject" title="hscommon.gui.base.GUIObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUIObject</span></code></a> and <a class="reference internal" href="../jobprogress/performer.html#hscommon.jobprogress.performer.ThreadedJobPerformer" title="hscommon.jobprogress.performer.ThreadedJobPerformer"><code class="xref py py-class docutils literal notranslate"><span class="pre">ThreadedJobPerformer</span></code></a>.
|
||||
Expected view: <a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindowView" title="hscommon.gui.progress_window.ProgressWindowView"><code class="xref py py-class docutils literal notranslate"><span class="pre">ProgressWindowView</span></code></a>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>finish_func</strong> – A function <code class="docutils literal notranslate"><span class="pre">f(jobid)</span></code> that is called when a job is completed. <code class="docutils literal notranslate"><span class="pre">jobid</span></code> is
|
||||
an arbitrary id passed to <a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindow.run" title="hscommon.gui.progress_window.ProgressWindow.run"><code class="xref py py-meth docutils literal notranslate"><span class="pre">run()</span></code></a>.</li>
|
||||
<li><strong>error_func</strong> – A function <code class="docutils literal notranslate"><span class="pre">f(jobid,</span> <span class="pre">err)</span></code> that is called when an exception is raised and
|
||||
unhandled during the job. If not specified, the error will be raised in the
|
||||
main thread. If it’s specified, it’s your responsibility to raise the error
|
||||
if you want to. If the function returns <code class="docutils literal notranslate"><span class="pre">True</span></code>, <code class="docutils literal notranslate"><span class="pre">finish_func()</span></code> will be
|
||||
called as if the job terminated normally.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindow.cancel">
|
||||
<code class="descname">cancel</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindow.cancel" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Call for a user-initiated job cancellation.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindow.pulse">
|
||||
<code class="descname">pulse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindow.pulse" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Update progress reports in the GUI.</p>
|
||||
<p>Call this regularly from the GUI main run loop. The values might change before
|
||||
<a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindowView.set_progress" title="hscommon.gui.progress_window.ProgressWindowView.set_progress"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ProgressWindowView.set_progress()</span></code></a> happens.</p>
|
||||
<p>If the job is finished, <code class="docutils literal notranslate"><span class="pre">pulse()</span></code> will take care of closing the window and re-raising any
|
||||
exception that might have been raised during the job (in the main thread this time). If
|
||||
there was no exception, <code class="docutils literal notranslate"><span class="pre">finish_func(jobid)</span></code> is called to let you take appropriate action.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindow.run">
|
||||
<code class="descname">run</code><span class="sig-paren">(</span><em>jobid</em>, <em>title</em>, <em>target</em>, <em>args=()</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindow.run" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Starts a threaded job.</p>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">target</span></code> function will be sent, as its first argument, a <a class="reference internal" href="../jobprogress/job.html#hscommon.jobprogress.job.Job" title="hscommon.jobprogress.job.Job"><code class="xref py py-class docutils literal notranslate"><span class="pre">Job</span></code></a> instance which
|
||||
it can use to report on its progress.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>jobid</strong> – Arbitrary identifier which will be passed to <code class="docutils literal notranslate"><span class="pre">finish_func()</span></code> at the end.</li>
|
||||
<li><strong>title</strong> – A title for the task you’re starting.</li>
|
||||
<li><strong>target</strong> – The function that does your famous long running job.</li>
|
||||
<li><strong>args</strong> – additional arguments that you want to send to <code class="docutils literal notranslate"><span class="pre">target</span></code>.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindow.jobdesc_textfield">
|
||||
<code class="descname">jobdesc_textfield</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindow.jobdesc_textfield" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><a class="reference internal" href="text_field.html#hscommon.gui.text_field.TextField" title="hscommon.gui.text_field.TextField"><code class="xref py py-class docutils literal notranslate"><span class="pre">TextField</span></code></a>. It contains that title you gave the job on <a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindow.run" title="hscommon.gui.progress_window.ProgressWindow.run"><code class="xref py py-meth docutils literal notranslate"><span class="pre">run()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindow.progressdesc_textfield">
|
||||
<code class="descname">progressdesc_textfield</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindow.progressdesc_textfield" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><a class="reference internal" href="text_field.html#hscommon.gui.text_field.TextField" title="hscommon.gui.text_field.TextField"><code class="xref py py-class docutils literal notranslate"><span class="pre">TextField</span></code></a>. It contains the job textual update that the function might yield
|
||||
during its course.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindowView">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.progress_window.</code><code class="descname">ProgressWindowView</code><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindowView" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Expected interface for <a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindow" title="hscommon.gui.progress_window.ProgressWindow"><code class="xref py py-class docutils literal notranslate"><span class="pre">ProgressWindow</span></code></a>’s view.</p>
|
||||
<p><em>Not actually used in the code. For documentation purposes only.</em></p>
|
||||
<p>Our view, some kind window with a progress bar, two labels and a cancel button, is expected
|
||||
to properly respond to its callbacks.</p>
|
||||
<p>It’s also expected to call <a class="reference internal" href="#hscommon.gui.progress_window.ProgressWindow.cancel" title="hscommon.gui.progress_window.ProgressWindow.cancel"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ProgressWindow.cancel()</span></code></a> when the cancel button is clicked.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindowView.close">
|
||||
<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindowView.close" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Close the dialog.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindowView.set_progress">
|
||||
<code class="descname">set_progress</code><span class="sig-paren">(</span><em>progress</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindowView.set_progress" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set the progress of the progress bar to <code class="docutils literal notranslate"><span class="pre">progress</span></code>.</p>
|
||||
<p>Not all jobs are equally responsive on their job progress report and it is recommended that
|
||||
you put your progressbar in “indeterminate” mode as long as you haven’t received the first
|
||||
<code class="docutils literal notranslate"><span class="pre">set_progress()</span></code> call to avoid letting the user think that the app is frozen.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>progress</strong> (<em>int</em>) – a value between <code class="docutils literal notranslate"><span class="pre">0</span></code> and <code class="docutils literal notranslate"><span class="pre">100</span></code>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.progress_window.ProgressWindowView.show">
|
||||
<code class="descname">show</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.progress_window.ProgressWindowView.show" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Show the dialog.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="column.html">hscommon.gui.column</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="selectable_list.html">hscommon.gui.selectable_list</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
232
help/en/developer/hscommon/gui/selectable_list.html
Normal file
232
help/en/developer/hscommon/gui/selectable_list.html
Normal file
@@ -0,0 +1,232 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.gui.selectable_list — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon.gui.table" href="table.html" />
|
||||
<link rel="prev" title="hscommon.gui.progress_window" href="progress_window.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.gui.selectable_list</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="progress_window.html">hscommon.gui.progress_window</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="table.html">hscommon.gui.table</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.gui.selectable_list">
|
||||
<span id="hscommon-gui-selectable-list"></span><h1>hscommon.gui.selectable_list<a class="headerlink" href="#module-hscommon.gui.selectable_list" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.selectable_list.Selectable" title="hscommon.gui.selectable_list.Selectable"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Selectable</span></code></a>()</td>
|
||||
<td>Mix-in for a <code class="docutils literal notranslate"><span class="pre">Sequence</span></code> that manages its selection status.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.gui.selectable_list.SelectableList" title="hscommon.gui.selectable_list.SelectableList"><code class="xref py py-obj docutils literal notranslate"><span class="pre">SelectableList</span></code></a>([items])</td>
|
||||
<td>A list that can manage selection of its items.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.selectable_list.GUISelectableList" title="hscommon.gui.selectable_list.GUISelectableList"><code class="xref py py-obj docutils literal notranslate"><span class="pre">GUISelectableList</span></code></a>([items])</td>
|
||||
<td>Cross-toolkit GUI-enabled list view.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.gui.selectable_list.GUISelectableListView" title="hscommon.gui.selectable_list.GUISelectableListView"><code class="xref py py-obj docutils literal notranslate"><span class="pre">GUISelectableListView</span></code></a></td>
|
||||
<td>Expected interface for <a class="reference internal" href="#hscommon.gui.selectable_list.GUISelectableList" title="hscommon.gui.selectable_list.GUISelectableList"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUISelectableList</span></code></a>’s view.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.selectable_list.Selectable">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.selectable_list.</code><code class="descname">Selectable</code><a class="headerlink" href="#hscommon.gui.selectable_list.Selectable" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Mix-in for a <code class="docutils literal notranslate"><span class="pre">Sequence</span></code> that manages its selection status.</p>
|
||||
<p>When mixed in with a <code class="docutils literal notranslate"><span class="pre">Sequence</span></code>, we enable it to manage its selection status. The selection
|
||||
is held as a list of <code class="docutils literal notranslate"><span class="pre">int</span></code> indexes. Multiple selection is supported.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.Selectable._update_selection">
|
||||
<code class="descname">_update_selection</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.Selectable._update_selection" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Updates the model’s selection appropriately.</p>
|
||||
<p>Called after selection has been updated. Takes the table’s selection and does appropriates
|
||||
updates on the view and/or model. Common sense would dictate that when the selection doesn’t
|
||||
change, we don’t update anything (and thus don’t call <code class="docutils literal notranslate"><span class="pre">_update_selection()</span></code> at all), but
|
||||
there are cases where it’s false. For example, if our list updates its items but doesn’t
|
||||
change its selection, we probably want to update the model’s selection.</p>
|
||||
<p>By default, does nothing.</p>
|
||||
<p>Important note: This is only called on <a class="reference internal" href="#hscommon.gui.selectable_list.Selectable.select" title="hscommon.gui.selectable_list.Selectable.select"><code class="xref py py-meth docutils literal notranslate"><span class="pre">select()</span></code></a>, not on changes to
|
||||
<a class="reference internal" href="#hscommon.gui.selectable_list.Selectable.selected_indexes" title="hscommon.gui.selectable_list.Selectable.selected_indexes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_indexes</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.Selectable.select">
|
||||
<code class="descname">select</code><span class="sig-paren">(</span><em>indexes</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.Selectable.select" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Update selection to <code class="docutils literal notranslate"><span class="pre">indexes</span></code>.</p>
|
||||
<p><a class="reference internal" href="#hscommon.gui.selectable_list.Selectable._update_selection" title="hscommon.gui.selectable_list.Selectable._update_selection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">_update_selection()</span></code></a> is called afterwards.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>indexes</strong> (<em>list</em>) – List of <code class="docutils literal notranslate"><span class="pre">int</span></code> that is to become the new selection.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.selectable_list.Selectable.selected_index">
|
||||
<code class="descname">selected_index</code><a class="headerlink" href="#hscommon.gui.selectable_list.Selectable.selected_index" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Points to the first selected index.</p>
|
||||
<p><em>int</em>. <em>get/set</em>.</p>
|
||||
<p>Thin wrapper around <a class="reference internal" href="#hscommon.gui.selectable_list.Selectable.selected_indexes" title="hscommon.gui.selectable_list.Selectable.selected_indexes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_indexes</span></code></a>. <code class="docutils literal notranslate"><span class="pre">None</span></code> if selection is empty. Using this
|
||||
property only makes sense if your selectable sequence supports single selection only.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.selectable_list.Selectable.selected_indexes">
|
||||
<code class="descname">selected_indexes</code><a class="headerlink" href="#hscommon.gui.selectable_list.Selectable.selected_indexes" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>List of selected indexes.</p>
|
||||
<p><em>list of int</em>. <em>get/set</em>.</p>
|
||||
<p>When setting the value, automatically removes out-of-bounds indexes. The list is kept
|
||||
sorted.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.selectable_list.SelectableList">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.selectable_list.</code><code class="descname">SelectableList</code><span class="sig-paren">(</span><em>items=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.SelectableList" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A list that can manage selection of its items.</p>
|
||||
<p>Subclasses <a class="reference internal" href="#hscommon.gui.selectable_list.Selectable" title="hscommon.gui.selectable_list.Selectable"><code class="xref py py-class docutils literal notranslate"><span class="pre">Selectable</span></code></a>. Behaves like a <code class="docutils literal notranslate"><span class="pre">list</span></code>.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.SelectableList._on_change">
|
||||
<code class="descname">_on_change</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.SelectableList._on_change" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Called whenever the contents of the list changes.</p>
|
||||
<p>By default, does nothing.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.SelectableList.append">
|
||||
<code class="descname">append</code><span class="sig-paren">(</span><em>item</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.SelectableList.append" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>S.append(value) – append value to the end of the sequence</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.SelectableList.insert">
|
||||
<code class="descname">insert</code><span class="sig-paren">(</span><em>index</em>, <em>item</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.SelectableList.insert" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>S.insert(index, value) – insert value before index</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.SelectableList.remove">
|
||||
<code class="descname">remove</code><span class="sig-paren">(</span><em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.SelectableList.remove" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>S.remove(value) – remove first occurrence of value.
|
||||
Raise ValueError if the value is not present.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.selectable_list.GUISelectableList">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.selectable_list.</code><code class="descname">GUISelectableList</code><span class="sig-paren">(</span><em>items=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.GUISelectableList" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Cross-toolkit GUI-enabled list view.</p>
|
||||
<p>Represents a UI element presenting the user with a selectable list of items.</p>
|
||||
<p>Subclasses <a class="reference internal" href="#hscommon.gui.selectable_list.SelectableList" title="hscommon.gui.selectable_list.SelectableList"><code class="xref py py-class docutils literal notranslate"><span class="pre">SelectableList</span></code></a> and <a class="reference internal" href="base.html#hscommon.gui.base.GUIObject" title="hscommon.gui.base.GUIObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUIObject</span></code></a>. Expected view:
|
||||
<a class="reference internal" href="#hscommon.gui.selectable_list.GUISelectableListView" title="hscommon.gui.selectable_list.GUISelectableListView"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUISelectableListView</span></code></a>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>items</strong> (<em>iterable</em>) – If specified, items to fill the list with initially.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.GUISelectableList._on_change">
|
||||
<code class="descname">_on_change</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.GUISelectableList._on_change" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Refreshes the view contents with <a class="reference internal" href="#hscommon.gui.selectable_list.GUISelectableListView.refresh" title="hscommon.gui.selectable_list.GUISelectableListView.refresh"><code class="xref py py-meth docutils literal notranslate"><span class="pre">GUISelectableListView.refresh()</span></code></a>.</p>
|
||||
<p>Overrides <a class="reference internal" href="#hscommon.gui.selectable_list.SelectableList._on_change" title="hscommon.gui.selectable_list.SelectableList._on_change"><code class="xref py py-meth docutils literal notranslate"><span class="pre">SelectableList._on_change()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.GUISelectableList._update_selection">
|
||||
<code class="descname">_update_selection</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.GUISelectableList._update_selection" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Refreshes the view selection with <a class="reference internal" href="#hscommon.gui.selectable_list.GUISelectableListView.update_selection" title="hscommon.gui.selectable_list.GUISelectableListView.update_selection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">GUISelectableListView.update_selection()</span></code></a>.</p>
|
||||
<p>Overrides <a class="reference internal" href="#hscommon.gui.selectable_list.Selectable._update_selection" title="hscommon.gui.selectable_list.Selectable._update_selection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Selectable._update_selection()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.GUISelectableList._view_updated">
|
||||
<code class="descname">_view_updated</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.GUISelectableList._view_updated" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Refreshes the view contents with <a class="reference internal" href="#hscommon.gui.selectable_list.GUISelectableListView.refresh" title="hscommon.gui.selectable_list.GUISelectableListView.refresh"><code class="xref py py-meth docutils literal notranslate"><span class="pre">GUISelectableListView.refresh()</span></code></a>.</p>
|
||||
<p>Overrides <a class="reference internal" href="base.html#hscommon.gui.base.GUIObject._view_updated" title="hscommon.gui.base.GUIObject._view_updated"><code class="xref py py-meth docutils literal notranslate"><span class="pre">_view_updated()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.selectable_list.GUISelectableListView">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.selectable_list.</code><code class="descname">GUISelectableListView</code><a class="headerlink" href="#hscommon.gui.selectable_list.GUISelectableListView" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Expected interface for <a class="reference internal" href="#hscommon.gui.selectable_list.GUISelectableList" title="hscommon.gui.selectable_list.GUISelectableList"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUISelectableList</span></code></a>’s view.</p>
|
||||
<p><em>Not actually used in the code. For documentation purposes only.</em></p>
|
||||
<p>Our view, some kind of list view or combobox, is expected to sync with the list’s contents by
|
||||
appropriately behave to all callbacks in this interface.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.GUISelectableListView.refresh">
|
||||
<code class="descname">refresh</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.GUISelectableListView.refresh" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Refreshes the contents of the list widget.</p>
|
||||
<p>Ensures that the contents of the list widget is synced with the model.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.selectable_list.GUISelectableListView.update_selection">
|
||||
<code class="descname">update_selection</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.selectable_list.GUISelectableListView.update_selection" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Update selection status.</p>
|
||||
<p>Ensures that the list widget’s selection is in sync with the model.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="progress_window.html">hscommon.gui.progress_window</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="table.html">hscommon.gui.table</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
441
help/en/developer/hscommon/gui/table.html
Normal file
441
help/en/developer/hscommon/gui/table.html
Normal file
@@ -0,0 +1,441 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.gui.table — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon.gui.text_field" href="text_field.html" />
|
||||
<link rel="prev" title="hscommon.gui.selectable_list" href="selectable_list.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.gui.table</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="selectable_list.html">hscommon.gui.selectable_list</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="text_field.html">hscommon.gui.text_field</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.gui.table">
|
||||
<span id="hscommon-gui-table"></span><h1>hscommon.gui.table<a class="headerlink" href="#module-hscommon.gui.table" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.table.Table" title="hscommon.gui.table.Table"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Table</span></code></a>()</td>
|
||||
<td>Sortable and selectable sequence of <a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Row</span></code></a>(table)</td>
|
||||
<td>Represents a row in a <a class="reference internal" href="#hscommon.gui.table.Table" title="hscommon.gui.table.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a>.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.table.GUITable" title="hscommon.gui.table.GUITable"><code class="xref py py-obj docutils literal notranslate"><span class="pre">GUITable</span></code></a>()</td>
|
||||
<td>Cross-toolkit GUI-enabled table view.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.gui.table.GUITableView" title="hscommon.gui.table.GUITableView"><code class="xref py py-obj docutils literal notranslate"><span class="pre">GUITableView</span></code></a></td>
|
||||
<td>Expected interface for <a class="reference internal" href="#hscommon.gui.table.GUITable" title="hscommon.gui.table.GUITable"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUITable</span></code></a>’s view.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.table.Table">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.table.</code><code class="descname">Table</code><a class="headerlink" href="#hscommon.gui.table.Table" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Sortable and selectable sequence of <a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>.</p>
|
||||
<p>In fact, the Table is very similar to <a class="reference internal" href="selectable_list.html#hscommon.gui.selectable_list.SelectableList" title="hscommon.gui.selectable_list.SelectableList"><code class="xref py py-class docutils literal notranslate"><span class="pre">SelectableList</span></code></a> in
|
||||
practice and differs mostly in principle. Their difference lies in the nature of their items
|
||||
they manage. With the Table, rows usually have many properties, presented in columns, and they
|
||||
have to subclass <a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>.</p>
|
||||
<p>Usually used with <a class="reference internal" href="column.html#hscommon.gui.column.Column" title="hscommon.gui.column.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a>.</p>
|
||||
<p>Subclasses <a class="reference internal" href="selectable_list.html#hscommon.gui.selectable_list.Selectable" title="hscommon.gui.selectable_list.Selectable"><code class="xref py py-class docutils literal notranslate"><span class="pre">Selectable</span></code></a>.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Table.append">
|
||||
<code class="descname">append</code><span class="sig-paren">(</span><em>item</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Table.append" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Appends <code class="docutils literal notranslate"><span class="pre">item</span></code> at the end of the table.</p>
|
||||
<p>If there’s a footer, the item is inserted before it.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Table.insert">
|
||||
<code class="descname">insert</code><span class="sig-paren">(</span><em>index</em>, <em>item</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Table.insert" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Inserts <code class="docutils literal notranslate"><span class="pre">item</span></code> at <code class="docutils literal notranslate"><span class="pre">index</span></code> in the table.</p>
|
||||
<p>If there’s a header, will make sure we don’t insert before it, and if there’s a footer, will
|
||||
make sure that we don’t insert after it.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Table.remove">
|
||||
<code class="descname">remove</code><span class="sig-paren">(</span><em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Table.remove" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Removes <code class="docutils literal notranslate"><span class="pre">row</span></code> from table.</p>
|
||||
<p>If <code class="docutils literal notranslate"><span class="pre">row</span></code> is a header or footer, that header or footer will be set to <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Table.sort_by">
|
||||
<code class="descname">sort_by</code><span class="sig-paren">(</span><em>column_name</em>, <em>desc=False</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Table.sort_by" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Sort table by <code class="docutils literal notranslate"><span class="pre">column_name</span></code>.</p>
|
||||
<p>Sort key for each row is computed from <a class="reference internal" href="#hscommon.gui.table.Row.sort_key_for_column" title="hscommon.gui.table.Row.sort_key_for_column"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Row.sort_key_for_column()</span></code></a>.</p>
|
||||
<p>If <code class="docutils literal notranslate"><span class="pre">desc</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code>, sort order is reversed.</p>
|
||||
<p>If present, header and footer will always be first and last, respectively.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.table.Table.footer">
|
||||
<code class="descname">footer</code><a class="headerlink" href="#hscommon.gui.table.Table.footer" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>If set, a row that always stay at the bottom of the table.</p>
|
||||
<p><a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>. <em>get/set</em>.</p>
|
||||
<p>When set to something else than <code class="docutils literal notranslate"><span class="pre">None</span></code>, <code class="docutils literal notranslate"><span class="pre">header</span></code> and <code class="docutils literal notranslate"><span class="pre">footer</span></code> represent rows that will
|
||||
always be kept in first and/or last position, regardless of sorting. <code class="docutils literal notranslate"><span class="pre">len()</span></code> and indexing
|
||||
will include them, which means that if there’s a header, <code class="docutils literal notranslate"><span class="pre">table[0]</span></code> returns it and if
|
||||
there’s a footer, <code class="docutils literal notranslate"><span class="pre">table[-1]</span></code> returns it. To make things short, all list-like functions
|
||||
work with header and footer “on”. But things get fuzzy for <code class="docutils literal notranslate"><span class="pre">append()</span></code> and <code class="docutils literal notranslate"><span class="pre">insert()</span></code>
|
||||
because these will ensure that no “normal” row gets inserted before the header or after the
|
||||
footer.</p>
|
||||
<p>Adding and removing footer here and there might seem (and is) hackish, but it’s much simpler
|
||||
than the alternative (when, of course, you need such a feature), which is to override magic
|
||||
methods and adjust the results. When we do that, there the slice stuff that we have to
|
||||
implement and it gets quite complex. Moreover, the most frequent operation on a table is
|
||||
<code class="docutils literal notranslate"><span class="pre">__getitem__</span></code>, and making checks to know whether the key is a header or footer at each
|
||||
call would make that operation, which is the most used, slower.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.table.Table.header">
|
||||
<code class="descname">header</code><a class="headerlink" href="#hscommon.gui.table.Table.header" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>If set, a row that always stay at the bottom of the table.</p>
|
||||
<p>See <a class="reference internal" href="#hscommon.gui.table.Table.footer" title="hscommon.gui.table.Table.footer"><code class="xref py py-attr docutils literal notranslate"><span class="pre">footer</span></code></a> for details.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.table.Table.row_count">
|
||||
<code class="descname">row_count</code><a class="headerlink" href="#hscommon.gui.table.Table.row_count" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Number or rows in the table (without counting header and footer).</p>
|
||||
<p><em>int</em>. <em>read-only</em>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.table.Table.rows">
|
||||
<code class="descname">rows</code><a class="headerlink" href="#hscommon.gui.table.Table.rows" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>List of rows in the table, excluding header and footer.</p>
|
||||
<p>List of <a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>. <em>read-only</em>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.table.Table.selected_row">
|
||||
<code class="descname">selected_row</code><a class="headerlink" href="#hscommon.gui.table.Table.selected_row" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Selected row according to <code class="xref py py-attr docutils literal notranslate"><span class="pre">Selectable.selected_index</span></code>.</p>
|
||||
<p><a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>. <em>get/set</em>.</p>
|
||||
<p>When setting this attribute, we look up the index of the row and set the selected index from
|
||||
there. If the row isn’t in the list, selection isn’t changed.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.table.Table.selected_rows">
|
||||
<code class="descname">selected_rows</code><a class="headerlink" href="#hscommon.gui.table.Table.selected_rows" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>List of selected rows based on <a class="reference internal" href="selectable_list.html#hscommon.gui.selectable_list.Selectable.selected_indexes" title="hscommon.gui.selectable_list.Selectable.selected_indexes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_indexes</span></code></a>.</p>
|
||||
<p>List of <a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>. <em>read-only</em>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.table.Row">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.table.</code><code class="descname">Row</code><span class="sig-paren">(</span><em>table</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Row" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Represents a row in a <a class="reference internal" href="#hscommon.gui.table.Table" title="hscommon.gui.table.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a>.</p>
|
||||
<p>It holds multiple values to be represented through columns. It’s its role to prepare data
|
||||
fetched from model instances into ready-to-present-in-a-table fashion. You will do this in
|
||||
<a class="reference internal" href="#hscommon.gui.table.Row.load" title="hscommon.gui.table.Row.load"><code class="xref py py-meth docutils literal notranslate"><span class="pre">load()</span></code></a>.</p>
|
||||
<p>When you do this, you’ll put the result into arbitrary attributes, which will later be fetched
|
||||
by your table for presentation to the user.</p>
|
||||
<p>You can organize your attributes in whatever way you want, but there’s a convention you can
|
||||
follow if you want to minimize subclassing and use default behavior:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Attribute name = column name. If your attribute is <code class="docutils literal notranslate"><span class="pre">foobar</span></code>, whenever we refer to
|
||||
<code class="docutils literal notranslate"><span class="pre">column_name</span></code>, you refer to that attribute with the column name <code class="docutils literal notranslate"><span class="pre">foobar</span></code>.</li>
|
||||
<li>Public attributes are for <em>formatted</em> value, that is, user readable strings.</li>
|
||||
<li>Underscore prefix is the unformatted (computable) value. For example, you could have
|
||||
<code class="docutils literal notranslate"><span class="pre">_foobar</span></code> at <code class="docutils literal notranslate"><span class="pre">42</span></code> and <code class="docutils literal notranslate"><span class="pre">foobar</span></code> at <code class="docutils literal notranslate"><span class="pre">"42</span> <span class="pre">seconds"</span></code> (what you present to the user).</li>
|
||||
<li>Unformatted values are used for sorting.</li>
|
||||
<li>If your column name is a python keyword, add an underscore suffix (<code class="docutils literal notranslate"><span class="pre">from_</span></code>).</li>
|
||||
</ol>
|
||||
<p>Of course, this is only default behavior. This can be overriden.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Row.can_edit">
|
||||
<code class="descname">can_edit</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Row.can_edit" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Whether the whole row can be edited.</p>
|
||||
<p>By default, always returns <code class="docutils literal notranslate"><span class="pre">True</span></code>. This is for the <em>whole</em> row. For individual cells, it’s
|
||||
<a class="reference internal" href="#hscommon.gui.table.Row.can_edit_cell" title="hscommon.gui.table.Row.can_edit_cell"><code class="xref py py-meth docutils literal notranslate"><span class="pre">can_edit_cell()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Row.can_edit_cell">
|
||||
<code class="descname">can_edit_cell</code><span class="sig-paren">(</span><em>column_name</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Row.can_edit_cell" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns whether cell for column <code class="docutils literal notranslate"><span class="pre">column_name</span></code> can be edited.</p>
|
||||
<p>By the default, the check is done in many steps:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>We check whether the whole row can be edited with <a class="reference internal" href="#hscommon.gui.table.Row.can_edit" title="hscommon.gui.table.Row.can_edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">can_edit()</span></code></a>. If it can’t, the cell
|
||||
can’t either.</li>
|
||||
<li>If the column doesn’t exist as an attribute, we can’t edit.</li>
|
||||
<li>If we have an attribute <code class="docutils literal notranslate"><span class="pre">can_edit_<column_name></span></code>, return that.</li>
|
||||
<li>Check if our attribute is a property. If it’s not, it’s not editable.</li>
|
||||
<li>If our attribute is in fact a property, check whether the property is “settable” (has a
|
||||
<code class="docutils literal notranslate"><span class="pre">fset</span></code> method). The cell is editable only if the property is “settable”.</li>
|
||||
</ol>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Row.get_cell_value">
|
||||
<code class="descname">get_cell_value</code><span class="sig-paren">(</span><em>attrname</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Row.get_cell_value" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get cell value for <code class="docutils literal notranslate"><span class="pre">attrname</span></code>.</p>
|
||||
<p>By default, does a simple <code class="docutils literal notranslate"><span class="pre">getattr()</span></code>, but it is used to allow subclasses to have
|
||||
alternative value storage mechanisms.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Row.load">
|
||||
<code class="descname">load</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Row.load" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual/Required) Loads up values from the model to be presented in the table.</p>
|
||||
<p>Usually, our model instances contain values that are not quite ready for display. If you
|
||||
have number formatting, display calculations and other whatnots to perform, you do it here
|
||||
and then you put the result in an arbitrary attribute of the row.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Row.save">
|
||||
<code class="descname">save</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Row.save" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual/Required) Saves user edits into your model.</p>
|
||||
<p>If your table is editable, this is called when the user commits his changes. Usually, these
|
||||
are typed up stuff, or selected indexes. You have to do proper parsing and reference
|
||||
linking, and save that stuff into your model.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Row.set_cell_value">
|
||||
<code class="descname">set_cell_value</code><span class="sig-paren">(</span><em>attrname</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Row.set_cell_value" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set cell value to <code class="docutils literal notranslate"><span class="pre">value</span></code> for <code class="docutils literal notranslate"><span class="pre">attrname</span></code>.</p>
|
||||
<p>By default, does a simple <code class="docutils literal notranslate"><span class="pre">setattr()</span></code>, but it is used to allow subclasses to have
|
||||
alternative value storage mechanisms.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.Row.sort_key_for_column">
|
||||
<code class="descname">sort_key_for_column</code><span class="sig-paren">(</span><em>column_name</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.Row.sort_key_for_column" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Return the value that is to be used to sort by column <code class="docutils literal notranslate"><span class="pre">column_name</span></code>.</p>
|
||||
<p>By default, looks for an attribute with the same name as <code class="docutils literal notranslate"><span class="pre">column_name</span></code>, but with an
|
||||
underscore prefix (“unformatted value”). If there’s none, tries without the underscore. If
|
||||
there’s none, raises <code class="docutils literal notranslate"><span class="pre">AttributeError</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.table.GUITable">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.table.</code><code class="descname">GUITable</code><a class="headerlink" href="#hscommon.gui.table.GUITable" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Cross-toolkit GUI-enabled table view.</p>
|
||||
<p>Represents a UI element presenting the user with a sortable, selectable, possibly editable,
|
||||
table view.</p>
|
||||
<p>Behaves like the <a class="reference internal" href="#hscommon.gui.table.Table" title="hscommon.gui.table.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> which it subclasses, but is more focused on being the presenter
|
||||
of some model data to its <a class="reference internal" href="base.html#hscommon.gui.base.GUIObject.view" title="hscommon.gui.base.GUIObject.view"><code class="xref py py-attr docutils literal notranslate"><span class="pre">GUIObject.view</span></code></a>. There’s a <a class="reference internal" href="#hscommon.gui.table.GUITable.refresh" title="hscommon.gui.table.GUITable.refresh"><code class="xref py py-meth docutils literal notranslate"><span class="pre">refresh()</span></code></a>
|
||||
mechanism which ensures fresh data while preserving sorting order and selection. There’s also an
|
||||
editing mechanism which tracks whether (and which) row is being edited (or added) and
|
||||
save/cancel edits when appropriate.</p>
|
||||
<p>Subclasses <a class="reference internal" href="#hscommon.gui.table.Table" title="hscommon.gui.table.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> and <a class="reference internal" href="base.html#hscommon.gui.base.GUIObject" title="hscommon.gui.base.GUIObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUIObject</span></code></a>. Expected view:
|
||||
<a class="reference internal" href="#hscommon.gui.table.GUITableView" title="hscommon.gui.table.GUITableView"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUITableView</span></code></a>.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable._do_add">
|
||||
<code class="descname">_do_add</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable._do_add" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Creates a new row, adds it in the table.</p>
|
||||
<p>Returns <code class="docutils literal notranslate"><span class="pre">(row,</span> <span class="pre">insert_index)</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable._do_delete">
|
||||
<code class="descname">_do_delete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable._do_delete" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Delete the selected rows.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable._fill">
|
||||
<code class="descname">_fill</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable._fill" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual/Required) Fills the table with all the rows that this table is supposed to have.</p>
|
||||
<p>Called by <a class="reference internal" href="#hscommon.gui.table.GUITable.refresh" title="hscommon.gui.table.GUITable.refresh"><code class="xref py py-meth docutils literal notranslate"><span class="pre">refresh()</span></code></a>. Does nothing by default.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable._is_edited_new">
|
||||
<code class="descname">_is_edited_new</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable._is_edited_new" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Returns whether the currently edited row should be considered “new”.</p>
|
||||
<p>This is used in <a class="reference internal" href="#hscommon.gui.table.GUITable.cancel_edits" title="hscommon.gui.table.GUITable.cancel_edits"><code class="xref py py-meth docutils literal notranslate"><span class="pre">cancel_edits()</span></code></a> to know whether the cancellation of the edit means a
|
||||
revert of the row’s value or the removal of the row.</p>
|
||||
<p>By default, always false.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable._restore_selection">
|
||||
<code class="descname">_restore_selection</code><span class="sig-paren">(</span><em>previous_selection</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable._restore_selection" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Restores row selection after a contents-changing operation.</p>
|
||||
<p>Before each contents changing operation, we store our previously selected indexes because in
|
||||
many cases, such as in <a class="reference internal" href="#hscommon.gui.table.GUITable.refresh" title="hscommon.gui.table.GUITable.refresh"><code class="xref py py-meth docutils literal notranslate"><span class="pre">refresh()</span></code></a>, our selection will be lost. After the operation is
|
||||
over, we call this method with our previously selected indexes (in <code class="docutils literal notranslate"><span class="pre">previous_selection</span></code>).</p>
|
||||
<p>The default behavior is (if we indeed have an empty <a class="reference internal" href="selectable_list.html#hscommon.gui.selectable_list.Selectable.selected_indexes" title="hscommon.gui.selectable_list.Selectable.selected_indexes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_indexes</span></code></a>) to re-select
|
||||
<code class="docutils literal notranslate"><span class="pre">previous_selection</span></code>. If it was empty, we select the last row of the table.</p>
|
||||
<p>This behavior can, of course, be overriden.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable.add">
|
||||
<code class="descname">add</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable.add" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Add a new row in edit mode.</p>
|
||||
<p>Requires <code class="xref py py-meth docutils literal notranslate"><span class="pre">do_add()</span></code> to be implemented. The newly added row will be selected and in edit
|
||||
mode.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable.can_edit_cell">
|
||||
<code class="descname">can_edit_cell</code><span class="sig-paren">(</span><em>column_name</em>, <em>row_index</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable.can_edit_cell" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns whether the cell at <code class="docutils literal notranslate"><span class="pre">row_index</span></code> and <code class="docutils literal notranslate"><span class="pre">column_name</span></code> can be edited.</p>
|
||||
<p>A row is, by default, editable as soon as it has an attr with the same name as <cite>column</cite>.
|
||||
If <a class="reference internal" href="#hscommon.gui.table.Row.can_edit" title="hscommon.gui.table.Row.can_edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Row.can_edit()</span></code></a> returns False, the row is not editable at all. You can set
|
||||
editability of rows at the attribute level with can_edit_* properties.</p>
|
||||
<p>Mostly just a shortcut to <a class="reference internal" href="#hscommon.gui.table.Row.can_edit_cell" title="hscommon.gui.table.Row.can_edit_cell"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Row.can_edit_cell()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable.cancel_edits">
|
||||
<code class="descname">cancel_edits</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable.cancel_edits" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Cancels the current edit operation.</p>
|
||||
<p>If there’s an <a class="reference internal" href="#hscommon.gui.table.GUITable.edited" title="hscommon.gui.table.GUITable.edited"><code class="xref py py-attr docutils literal notranslate"><span class="pre">edited</span></code></a> row, it will be re-initialized (with <a class="reference internal" href="#hscommon.gui.table.Row.load" title="hscommon.gui.table.Row.load"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Row.load()</span></code></a>).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable.delete">
|
||||
<code class="descname">delete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable.delete" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Delete the currently selected rows.</p>
|
||||
<p>Requires <a class="reference internal" href="#hscommon.gui.table.GUITable._do_delete" title="hscommon.gui.table.GUITable._do_delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">_do_delete()</span></code></a> for this to have any effect on the model. Cancels editing if
|
||||
relevant.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable.refresh">
|
||||
<code class="descname">refresh</code><span class="sig-paren">(</span><em>refresh_view=True</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable.refresh" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Empty the table and re-create its rows.</p>
|
||||
<p><a class="reference internal" href="#hscommon.gui.table.GUITable._fill" title="hscommon.gui.table.GUITable._fill"><code class="xref py py-meth docutils literal notranslate"><span class="pre">_fill()</span></code></a> is called after we emptied the table to create our rows. Previous sort order
|
||||
will be preserved, regardless of the order in which the rows were filled. If there was any
|
||||
edit operation taking place, it’s cancelled.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>refresh_view</strong> (<em>bool</em>) – Whether we tell our view to refresh after our refill operation.
|
||||
Most of the time, it’s what we want, but there’s some cases where
|
||||
we don’t.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable.save_edits">
|
||||
<code class="descname">save_edits</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable.save_edits" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Commit user edits to the model.</p>
|
||||
<p>This is done by calling <a class="reference internal" href="#hscommon.gui.table.Row.save" title="hscommon.gui.table.Row.save"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Row.save()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITable.sort_by">
|
||||
<code class="descname">sort_by</code><span class="sig-paren">(</span><em>column_name</em>, <em>desc=False</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITable.sort_by" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Sort table by <code class="docutils literal notranslate"><span class="pre">column_name</span></code>.</p>
|
||||
<p>Overrides <a class="reference internal" href="#hscommon.gui.table.Table.sort_by" title="hscommon.gui.table.Table.sort_by"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Table.sort_by()</span></code></a>. After having performed sorting, calls
|
||||
<a class="reference internal" href="selectable_list.html#hscommon.gui.selectable_list.Selectable._update_selection" title="hscommon.gui.selectable_list.Selectable._update_selection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">_update_selection()</span></code></a> to give you the chance,
|
||||
if appropriate, to update your selected indexes according to, maybe, the selection that you
|
||||
have in your model.</p>
|
||||
<p>Then, we refresh our view.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.table.GUITable.edited">
|
||||
<code class="descname">edited</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.table.GUITable.edited" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The row being currently edited by the user. <code class="docutils literal notranslate"><span class="pre">None</span></code> if no edit is taking place.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.table.GUITableView">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.table.</code><code class="descname">GUITableView</code><a class="headerlink" href="#hscommon.gui.table.GUITableView" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Expected interface for <a class="reference internal" href="#hscommon.gui.table.GUITable" title="hscommon.gui.table.GUITable"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUITable</span></code></a>’s view.</p>
|
||||
<p><em>Not actually used in the code. For documentation purposes only.</em></p>
|
||||
<p>Our view, some kind of table view, is expected to sync with the table’s contents by
|
||||
appropriately behave to all callbacks in this interface.</p>
|
||||
<p>When in edit mode, the content types by the user is expected to be sent as soon as possible
|
||||
to the <a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a>.</p>
|
||||
<p>Whenever the user changes the selection, we expect the view to call <code class="xref py py-meth docutils literal notranslate"><span class="pre">Table.select()</span></code>.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITableView.refresh">
|
||||
<code class="descname">refresh</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITableView.refresh" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Refreshes the contents of the table widget.</p>
|
||||
<p>Ensures that the contents of the table widget is synced with the model. This includes
|
||||
selection.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITableView.start_editing">
|
||||
<code class="descname">start_editing</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITableView.start_editing" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Start editing the currently selected row.</p>
|
||||
<p>Begin whatever inline editing support that the view supports.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.table.GUITableView.stop_editing">
|
||||
<code class="descname">stop_editing</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.table.GUITableView.stop_editing" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Stop editing if there’s an inline editing in effect.</p>
|
||||
<p>There’s no “aborting” implied in this call, so it’s appropriate to send whatever the user
|
||||
has typed and might not have been sent down to the <a class="reference internal" href="#hscommon.gui.table.Row" title="hscommon.gui.table.Row"><code class="xref py py-class docutils literal notranslate"><span class="pre">Row</span></code></a> yet. After you’ve done that,
|
||||
stop the editing mechanism.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="selectable_list.html">hscommon.gui.selectable_list</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="text_field.html">hscommon.gui.text_field</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
160
help/en/developer/hscommon/gui/text_field.html
Normal file
160
help/en/developer/hscommon/gui/text_field.html
Normal file
@@ -0,0 +1,160 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.gui.text_field — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon.gui.tree" href="tree.html" />
|
||||
<link rel="prev" title="hscommon.gui.table" href="table.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.gui.text_field</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="table.html">hscommon.gui.table</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="tree.html">hscommon.gui.tree</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.gui.text_field">
|
||||
<span id="hscommon-gui-text-field"></span><h1>hscommon.gui.text_field<a class="headerlink" href="#module-hscommon.gui.text_field" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.text_field.TextField" title="hscommon.gui.text_field.TextField"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TextField</span></code></a>()</td>
|
||||
<td>Cross-toolkit text field.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.gui.text_field.TextFieldView" title="hscommon.gui.text_field.TextFieldView"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TextFieldView</span></code></a></td>
|
||||
<td>Expected interface for <a class="reference internal" href="#hscommon.gui.text_field.TextField" title="hscommon.gui.text_field.TextField"><code class="xref py py-class docutils literal notranslate"><span class="pre">TextField</span></code></a>’s view.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.text_field.TextField">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.text_field.</code><code class="descname">TextField</code><a class="headerlink" href="#hscommon.gui.text_field.TextField" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Cross-toolkit text field.</p>
|
||||
<p>Represents a UI element allowing the user to input a text value. Its main attribute is
|
||||
<a class="reference internal" href="#hscommon.gui.text_field.TextField.text" title="hscommon.gui.text_field.TextField.text"><code class="xref py py-attr docutils literal notranslate"><span class="pre">text</span></code></a> which acts as the store of the said value.</p>
|
||||
<p>When our model value isn’t a string, we have a built-in parsing/formatting mechanism allowing
|
||||
us to directly retrieve/set our non-string value through <a class="reference internal" href="#hscommon.gui.text_field.TextField.value" title="hscommon.gui.text_field.TextField.value"><code class="xref py py-attr docutils literal notranslate"><span class="pre">value</span></code></a>.</p>
|
||||
<p>Subclasses <a class="reference internal" href="base.html#hscommon.gui.base.GUIObject" title="hscommon.gui.base.GUIObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUIObject</span></code></a>. Expected view: <a class="reference internal" href="#hscommon.gui.text_field.TextFieldView" title="hscommon.gui.text_field.TextFieldView"><code class="xref py py-class docutils literal notranslate"><span class="pre">TextFieldView</span></code></a>.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.text_field.TextField._format">
|
||||
<code class="descname">_format</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.text_field.TextField._format" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Formats <code class="docutils literal notranslate"><span class="pre">value</span></code> to put into <a class="reference internal" href="#hscommon.gui.text_field.TextField.text" title="hscommon.gui.text_field.TextField.text"><code class="xref py py-attr docutils literal notranslate"><span class="pre">text</span></code></a>.</p>
|
||||
<p>Returns the formatted version of <code class="docutils literal notranslate"><span class="pre">value</span></code>. Called whenever <a class="reference internal" href="#hscommon.gui.text_field.TextField.value" title="hscommon.gui.text_field.TextField.value"><code class="xref py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> changes.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.text_field.TextField._parse">
|
||||
<code class="descname">_parse</code><span class="sig-paren">(</span><em>text</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.text_field.TextField._parse" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Parses <code class="docutils literal notranslate"><span class="pre">text</span></code> to put into <a class="reference internal" href="#hscommon.gui.text_field.TextField.value" title="hscommon.gui.text_field.TextField.value"><code class="xref py py-attr docutils literal notranslate"><span class="pre">value</span></code></a>.</p>
|
||||
<p>Returns the parsed version of <code class="docutils literal notranslate"><span class="pre">text</span></code>. Called whenever <a class="reference internal" href="#hscommon.gui.text_field.TextField.text" title="hscommon.gui.text_field.TextField.text"><code class="xref py py-attr docutils literal notranslate"><span class="pre">text</span></code></a> changes.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.text_field.TextField._update">
|
||||
<code class="descname">_update</code><span class="sig-paren">(</span><em>newvalue</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.text_field.TextField._update" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Called whenever we have a new value.</p>
|
||||
<p>Whenever our text/value store changes to a new value (different from the old one), this
|
||||
method is called. By default, it does nothing but you can override it if you want.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.text_field.TextField._view_updated">
|
||||
<code class="descname">_view_updated</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.text_field.TextField._view_updated" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Called after <code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code> has been set.</p>
|
||||
<p>Doing nothing by default, this method is called after <code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code> has been set (it isn’t
|
||||
called when it’s unset, however). Use this for initialization code that requires a view
|
||||
(which is often the whole of the initialization code).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.text_field.TextField.refresh">
|
||||
<code class="descname">refresh</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.text_field.TextField.refresh" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Triggers a view <a class="reference internal" href="#hscommon.gui.text_field.TextFieldView.refresh" title="hscommon.gui.text_field.TextFieldView.refresh"><code class="xref py py-meth docutils literal notranslate"><span class="pre">refresh()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.text_field.TextField.text">
|
||||
<code class="descname">text</code><a class="headerlink" href="#hscommon.gui.text_field.TextField.text" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The text that is currently displayed in the widget.</p>
|
||||
<p><em>str</em>. <em>get/set</em>.</p>
|
||||
<p>This property can be set. When it is, <a class="reference internal" href="#hscommon.gui.text_field.TextField.refresh" title="hscommon.gui.text_field.TextField.refresh"><code class="xref py py-meth docutils literal notranslate"><span class="pre">refresh()</span></code></a> is called and the view is synced with
|
||||
our value. Always in sync with <a class="reference internal" href="#hscommon.gui.text_field.TextField.value" title="hscommon.gui.text_field.TextField.value"><code class="xref py py-attr docutils literal notranslate"><span class="pre">value</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.text_field.TextField.value">
|
||||
<code class="descname">value</code><a class="headerlink" href="#hscommon.gui.text_field.TextField.value" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The “parsed” representation of <a class="reference internal" href="#hscommon.gui.text_field.TextField.text" title="hscommon.gui.text_field.TextField.text"><code class="xref py py-attr docutils literal notranslate"><span class="pre">text</span></code></a>.</p>
|
||||
<p><em>arbitrary type</em>. <em>get/set</em>.</p>
|
||||
<p>By default, it’s a mirror of <a class="reference internal" href="#hscommon.gui.text_field.TextField.text" title="hscommon.gui.text_field.TextField.text"><code class="xref py py-attr docutils literal notranslate"><span class="pre">text</span></code></a>, but a subclass can override <a class="reference internal" href="#hscommon.gui.text_field.TextField._parse" title="hscommon.gui.text_field.TextField._parse"><code class="xref py py-meth docutils literal notranslate"><span class="pre">_parse()</span></code></a> and
|
||||
<a class="reference internal" href="#hscommon.gui.text_field.TextField._format" title="hscommon.gui.text_field.TextField._format"><code class="xref py py-meth docutils literal notranslate"><span class="pre">_format()</span></code></a> to have anything else. Always in sync with <a class="reference internal" href="#hscommon.gui.text_field.TextField.text" title="hscommon.gui.text_field.TextField.text"><code class="xref py py-attr docutils literal notranslate"><span class="pre">text</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.text_field.TextFieldView">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.text_field.</code><code class="descname">TextFieldView</code><a class="headerlink" href="#hscommon.gui.text_field.TextFieldView" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Expected interface for <a class="reference internal" href="#hscommon.gui.text_field.TextField" title="hscommon.gui.text_field.TextField"><code class="xref py py-class docutils literal notranslate"><span class="pre">TextField</span></code></a>’s view.</p>
|
||||
<p><em>Not actually used in the code. For documentation purposes only.</em></p>
|
||||
<p>Our view is expected to sync with <a class="reference internal" href="#hscommon.gui.text_field.TextField.text" title="hscommon.gui.text_field.TextField.text"><code class="xref py py-attr docutils literal notranslate"><span class="pre">TextField.text</span></code></a> “both ways”, that is, update the
|
||||
model’s text when the user types something, but also update the text field when <a class="reference internal" href="#hscommon.gui.text_field.TextFieldView.refresh" title="hscommon.gui.text_field.TextFieldView.refresh"><code class="xref py py-meth docutils literal notranslate"><span class="pre">refresh()</span></code></a>
|
||||
is called.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.text_field.TextFieldView.refresh">
|
||||
<code class="descname">refresh</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.text_field.TextFieldView.refresh" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Refreshes the contents of the input widget.</p>
|
||||
<p>Ensures that the contents of the input widget is actually <a class="reference internal" href="#hscommon.gui.text_field.TextField.text" title="hscommon.gui.text_field.TextField.text"><code class="xref py py-attr docutils literal notranslate"><span class="pre">TextField.text</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="table.html">hscommon.gui.table</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="tree.html">hscommon.gui.tree</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
260
help/en/developer/hscommon/gui/tree.html
Normal file
260
help/en/developer/hscommon/gui/tree.html
Normal file
@@ -0,0 +1,260 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.gui.tree — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="Changelog" href="../../../changelog.html" />
|
||||
<link rel="prev" title="hscommon.gui.text_field" href="text_field.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.gui.tree</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="text_field.html">hscommon.gui.text_field</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="../../../changelog.html">Changelog</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.gui.tree">
|
||||
<span id="hscommon-gui-tree"></span><h1>hscommon.gui.tree<a class="headerlink" href="#module-hscommon.gui.tree" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.gui.tree.Tree" title="hscommon.gui.tree.Tree"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Tree</span></code></a>()</td>
|
||||
<td>Cross-toolkit GUI-enabled tree view.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.gui.tree.Node" title="hscommon.gui.tree.Node"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Node</span></code></a>(name)</td>
|
||||
<td>Pretty bland node implementation to be used in a <a class="reference internal" href="#hscommon.gui.tree.Tree" title="hscommon.gui.tree.Tree"><code class="xref py py-class docutils literal notranslate"><span class="pre">Tree</span></code></a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.tree.Tree">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.tree.</code><code class="descname">Tree</code><a class="headerlink" href="#hscommon.gui.tree.Tree" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Cross-toolkit GUI-enabled tree view.</p>
|
||||
<p>This class is a bit too thin to be used as a tree view controller out of the box and HS apps
|
||||
that subclasses it each add quite a bit of logic to it to make it workable. Making this more
|
||||
usable out of the box is a work in progress.</p>
|
||||
<p>This class is here (in addition to being a <a class="reference internal" href="#hscommon.gui.tree.Node" title="hscommon.gui.tree.Node"><code class="xref py py-class docutils literal notranslate"><span class="pre">Node</span></code></a>) mostly to handle selection.</p>
|
||||
<p>Subclasses <a class="reference internal" href="#hscommon.gui.tree.Node" title="hscommon.gui.tree.Node"><code class="xref py py-class docutils literal notranslate"><span class="pre">Node</span></code></a> (it is the root node of all its children) and <a class="reference internal" href="base.html#hscommon.gui.base.GUIObject" title="hscommon.gui.base.GUIObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">GUIObject</span></code></a>.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Tree._select_nodes">
|
||||
<code class="descname">_select_nodes</code><span class="sig-paren">(</span><em>nodes</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Tree._select_nodes" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Customize node selection behavior.</p>
|
||||
<p>By default, simply set <a class="reference internal" href="#hscommon.gui.tree.Tree._selected_nodes" title="hscommon.gui.tree.Tree._selected_nodes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">_selected_nodes</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Tree._view_updated">
|
||||
<code class="descname">_view_updated</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Tree._view_updated" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>(Virtual) Called after <code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code> has been set.</p>
|
||||
<p>Doing nothing by default, this method is called after <code class="xref py py-attr docutils literal notranslate"><span class="pre">view</span></code> has been set (it isn’t
|
||||
called when it’s unset, however). Use this for initialization code that requires a view
|
||||
(which is often the whole of the initialization code).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Tree.clear">
|
||||
<code class="descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Tree.clear" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Clears the node of all its children.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Tree._selected_nodes">
|
||||
<code class="descname">_selected_nodes</code><em class="property"> = None</em><a class="headerlink" href="#hscommon.gui.tree.Tree._selected_nodes" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Where we store selected nodes (as a list of <a class="reference internal" href="#hscommon.gui.tree.Node" title="hscommon.gui.tree.Node"><code class="xref py py-class docutils literal notranslate"><span class="pre">Node</span></code></a>)</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Tree.selected_node">
|
||||
<code class="descname">selected_node</code><a class="headerlink" href="#hscommon.gui.tree.Tree.selected_node" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Currently selected node.</p>
|
||||
<p><em>:class:`Node`</em>. <em>get/set</em>.</p>
|
||||
<p>First of <a class="reference internal" href="#hscommon.gui.tree.Tree.selected_nodes" title="hscommon.gui.tree.Tree.selected_nodes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_nodes</span></code></a>. <code class="docutils literal notranslate"><span class="pre">None</span></code> if empty.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Tree.selected_nodes">
|
||||
<code class="descname">selected_nodes</code><a class="headerlink" href="#hscommon.gui.tree.Tree.selected_nodes" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>List of selected nodes in the tree.</p>
|
||||
<p><em>List of :class:`Node`</em>. <em>get/set</em>.</p>
|
||||
<p>We use nodes instead of indexes to store selection because it’s simpler when it’s time to
|
||||
manage selection of multiple node levels.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Tree.selected_path">
|
||||
<code class="descname">selected_path</code><a class="headerlink" href="#hscommon.gui.tree.Tree.selected_path" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Currently selected path.</p>
|
||||
<p><em>:attr:`Node.path`</em>. <em>get/set</em>.</p>
|
||||
<p>First of <a class="reference internal" href="#hscommon.gui.tree.Tree.selected_paths" title="hscommon.gui.tree.Tree.selected_paths"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_paths</span></code></a>. <code class="docutils literal notranslate"><span class="pre">None</span></code> if empty.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Tree.selected_paths">
|
||||
<code class="descname">selected_paths</code><a class="headerlink" href="#hscommon.gui.tree.Tree.selected_paths" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>List of selected paths in the tree.</p>
|
||||
<p><em>List of :attr:`Node.path`</em>. <em>get/set</em></p>
|
||||
<p>Computed from <a class="reference internal" href="#hscommon.gui.tree.Tree.selected_nodes" title="hscommon.gui.tree.Tree.selected_nodes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">selected_nodes</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.gui.tree.Node">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.gui.tree.</code><code class="descname">Node</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Node" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Pretty bland node implementation to be used in a <a class="reference internal" href="#hscommon.gui.tree.Tree" title="hscommon.gui.tree.Tree"><code class="xref py py-class docutils literal notranslate"><span class="pre">Tree</span></code></a>.</p>
|
||||
<p>It has a <a class="reference internal" href="#hscommon.gui.tree.Node.parent" title="hscommon.gui.tree.Node.parent"><code class="xref py py-attr docutils literal notranslate"><span class="pre">parent</span></code></a>, behaves like a list, its content being its children. Link integrity
|
||||
is somewhat enforced (adding a child to a node will set the child’s <a class="reference internal" href="#hscommon.gui.tree.Node.parent" title="hscommon.gui.tree.Node.parent"><code class="xref py py-attr docutils literal notranslate"><span class="pre">parent</span></code></a>, but that’s
|
||||
pretty much as far as we go, integrity-wise. Nodes don’t tend to move around much in a GUI
|
||||
tree). We don’t even check for infinite node loops. Don’t play around these grounds too much.</p>
|
||||
<p>Nodes are designed to be subclassed and given meaningful attributes (those you’ll want to
|
||||
display in your tree view), but they all have a <a class="reference internal" href="#hscommon.gui.tree.Node.name" title="hscommon.gui.tree.Node.name"><code class="xref py py-attr docutils literal notranslate"><span class="pre">name</span></code></a>, which is given on initialization.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Node.append">
|
||||
<code class="descname">append</code><span class="sig-paren">(</span><em>node</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Node.append" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>S.append(value) – append value to the end of the sequence</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Node.clear">
|
||||
<code class="descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Node.clear" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Clears the node of all its children.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Node.find">
|
||||
<code class="descname">find</code><span class="sig-paren">(</span><em>predicate</em>, <em>include_self=True</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Node.find" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return the first child to match <code class="docutils literal notranslate"><span class="pre">predicate</span></code>.</p>
|
||||
<p>See <a class="reference internal" href="#hscommon.gui.tree.Node.findall" title="hscommon.gui.tree.Node.findall"><code class="xref py py-meth docutils literal notranslate"><span class="pre">findall()</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Node.findall">
|
||||
<code class="descname">findall</code><span class="sig-paren">(</span><em>predicate</em>, <em>include_self=True</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Node.findall" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Yield all children matching <code class="docutils literal notranslate"><span class="pre">predicate</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>predicate</strong> – <code class="docutils literal notranslate"><span class="pre">f(node)</span> <span class="pre">--></span> <span class="pre">bool</span></code></li>
|
||||
<li><strong>include_self</strong> – Whether we can return <code class="docutils literal notranslate"><span class="pre">self</span></code> or we return only children.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Node.get_node">
|
||||
<code class="descname">get_node</code><span class="sig-paren">(</span><em>index_path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Node.get_node" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the node at <code class="docutils literal notranslate"><span class="pre">index_path</span></code>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>index_path</strong> – a list of int indexes leading to our node. See <a class="reference internal" href="#hscommon.gui.tree.Node.path" title="hscommon.gui.tree.Node.path"><code class="xref py py-attr docutils literal notranslate"><span class="pre">path</span></code></a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Node.get_path">
|
||||
<code class="descname">get_path</code><span class="sig-paren">(</span><em>target_node</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Node.get_path" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the <a class="reference internal" href="#hscommon.gui.tree.Node.path" title="hscommon.gui.tree.Node.path"><code class="xref py py-attr docutils literal notranslate"><span class="pre">path</span></code></a> of <code class="docutils literal notranslate"><span class="pre">target_node</span></code>.</p>
|
||||
<p>If <code class="docutils literal notranslate"><span class="pre">target_node</span></code> is <code class="docutils literal notranslate"><span class="pre">None</span></code>, returns <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.gui.tree.Node.insert">
|
||||
<code class="descname">insert</code><span class="sig-paren">(</span><em>index</em>, <em>node</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.gui.tree.Node.insert" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>S.insert(index, value) – insert value before index</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Node.children_count">
|
||||
<code class="descname">children_count</code><a class="headerlink" href="#hscommon.gui.tree.Node.children_count" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Same as <code class="docutils literal notranslate"><span class="pre">len(self)</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Node.name">
|
||||
<code class="descname">name</code><a class="headerlink" href="#hscommon.gui.tree.Node.name" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Name for the node, supplied on init.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Node.parent">
|
||||
<code class="descname">parent</code><a class="headerlink" href="#hscommon.gui.tree.Node.parent" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Parent of the node.</p>
|
||||
<p>If <code class="docutils literal notranslate"><span class="pre">None</span></code>, we have a root node.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Node.path">
|
||||
<code class="descname">path</code><a class="headerlink" href="#hscommon.gui.tree.Node.path" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A list of node indexes leading from the root node to <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
|
||||
<p>The path of a node is always related to its <a class="reference internal" href="#hscommon.gui.tree.Node.root" title="hscommon.gui.tree.Node.root"><code class="xref py py-attr docutils literal notranslate"><span class="pre">root</span></code></a>. It’s the sequences of index that
|
||||
we have to take to get to our node, starting from the root. For example, if
|
||||
<code class="docutils literal notranslate"><span class="pre">node.path</span> <span class="pre">==</span> <span class="pre">[1,</span> <span class="pre">2,</span> <span class="pre">3,</span> <span class="pre">4]</span></code>, it means that <code class="docutils literal notranslate"><span class="pre">node.root[1][2][3][4]</span> <span class="pre">is</span> <span class="pre">node</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.gui.tree.Node.root">
|
||||
<code class="descname">root</code><a class="headerlink" href="#hscommon.gui.tree.Node.root" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Root node of current node.</p>
|
||||
<p>To get it, we recursively follow our <a class="reference internal" href="#hscommon.gui.tree.Node.parent" title="hscommon.gui.tree.Node.parent"><code class="xref py py-attr docutils literal notranslate"><span class="pre">parent</span></code></a> chain until we have <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="text_field.html">hscommon.gui.text_field</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="../../../changelog.html">Changelog</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
83
help/en/developer/hscommon/index.html
Normal file
83
help/en/developer/hscommon/index.html
Normal file
@@ -0,0 +1,83 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="hscommon.build" href="build.html" />
|
||||
<link rel="prev" title="core.gui.deletion_options" href="../core/gui/deletion_options.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../core/gui/deletion_options.html">core.gui.deletion_options</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="build.html">hscommon.build</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="hscommon">
|
||||
<h1>hscommon<a class="headerlink" href="#hscommon" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="build.html">hscommon.build</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="conflict.html">hscommon.conflict</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="desktop.html">hscommon.desktop</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="notify.html">hscommon.notify</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="path.html">hscommon.path</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="util.html">hscommon.util</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="jobprogress/job.html">hscommon.jobprogress.job</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="jobprogress/performer.html">hscommon.jobprogress.performer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="jobprogress/qt.html">hscommon.jobprogress.qt</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="gui/base.html">hscommon.gui.base</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="gui/column.html">hscommon.gui.column</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="gui/progress_window.html">hscommon.gui.progress_window</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="gui/selectable_list.html">hscommon.gui.selectable_list</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="gui/table.html">hscommon.gui.table</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="gui/text_field.html">hscommon.gui.text_field</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="gui/tree.html">hscommon.gui.tree</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../core/gui/deletion_options.html">core.gui.deletion_options</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="build.html">hscommon.build</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
147
help/en/developer/hscommon/jobprogress/job.html
Normal file
147
help/en/developer/hscommon/jobprogress/job.html
Normal file
@@ -0,0 +1,147 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.jobprogress.job — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon.jobprogress.performer" href="performer.html" />
|
||||
<link rel="prev" title="hscommon.util" href="../util.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.jobprogress.job</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../util.html">hscommon.util</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="performer.html">hscommon.jobprogress.performer</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.jobprogress.job">
|
||||
<span id="hscommon-jobprogress-job"></span><h1>hscommon.jobprogress.job<a class="headerlink" href="#module-hscommon.jobprogress.job" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.jobprogress.job.Job" title="hscommon.jobprogress.job.Job"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Job</span></code></a>(job_proportions, callback)</td>
|
||||
<td>Manages a job’s progression and return it’s progression through a callback.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="#hscommon.jobprogress.job.NullJob" title="hscommon.jobprogress.job.NullJob"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NullJob</span></code></a>(*args, **kwargs)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.jobprogress.job.Job">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.jobprogress.job.</code><code class="descname">Job</code><span class="sig-paren">(</span><em>job_proportions</em>, <em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.job.Job" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Manages a job’s progression and return it’s progression through a callback.</p>
|
||||
<p>Note that this class is not foolproof. For example, you could call
|
||||
start_subjob, and then call add_progress from the parent job, and nothing
|
||||
would stop you from doing it. However, it would mess your progression
|
||||
because it is the sub job that is supposed to drive the progression.
|
||||
Another example would be to start a subjob, then start another, and call
|
||||
add_progress from the old subjob. Once again, it would mess your progression.
|
||||
There are no stops because it would remove the lightweight aspect of the
|
||||
class (A Job would need to have a Parent instead of just a callback,
|
||||
and the parent could be None. A lot of checks for nothing.).
|
||||
Another one is that nothing stops you from calling add_progress right after
|
||||
SkipJob.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.jobprogress.job.Job._do_update">
|
||||
<code class="descname">_do_update</code><span class="sig-paren">(</span><em>desc</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.job.Job._do_update" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Calls the callback function with a % progress as a parameter.</p>
|
||||
<p>The parameter is a int in the 0-100 range.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.jobprogress.job.Job._subjob_callback">
|
||||
<code class="descname">_subjob_callback</code><span class="sig-paren">(</span><em>progress</em>, <em>desc=''</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.job.Job._subjob_callback" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>This is the callback passed to children jobs.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.jobprogress.job.Job.iter_with_progress">
|
||||
<code class="descname">iter_with_progress</code><span class="sig-paren">(</span><em>iterable</em>, <em>desc_format=None</em>, <em>every=1</em>, <em>count=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.job.Job.iter_with_progress" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Iterate through <code class="docutils literal notranslate"><span class="pre">iterable</span></code> while automatically adding progress.</p>
|
||||
<p>WARNING: We need our iterable’s length. If <code class="docutils literal notranslate"><span class="pre">iterable</span></code> is not a sequence (that is,
|
||||
something we can call <code class="docutils literal notranslate"><span class="pre">len()</span></code> on), you <em>have</em> to specify a count through the <code class="docutils literal notranslate"><span class="pre">count</span></code>
|
||||
argument. If <code class="docutils literal notranslate"><span class="pre">count</span></code> is <code class="docutils literal notranslate"><span class="pre">None</span></code>, <code class="docutils literal notranslate"><span class="pre">len(iterable)</span></code> is used.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.jobprogress.job.Job.set_progress">
|
||||
<code class="descname">set_progress</code><span class="sig-paren">(</span><em>progress</em>, <em>desc=''</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.job.Job.set_progress" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Sets the progress of the current job to ‘progress’, and call the
|
||||
callback</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.jobprogress.job.Job.start_job">
|
||||
<code class="descname">start_job</code><span class="sig-paren">(</span><em>max_progress=100</em>, <em>desc=''</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.job.Job.start_job" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Begin work on the next job. You must not call start_job more than
|
||||
‘jobcount’ (in __init__) times.
|
||||
‘max’ is the job units you are to perform.
|
||||
‘desc’ is the description of the job.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.jobprogress.job.Job.start_subjob">
|
||||
<code class="descname">start_subjob</code><span class="sig-paren">(</span><em>job_proportions</em>, <em>desc=''</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.job.Job.start_subjob" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Starts a sub job. Use this when you want to split a job into
|
||||
multiple smaller jobs. Pretty handy when starting a process where you
|
||||
know how many subjobs you will have, but don’t know the work unit count
|
||||
for every of them.
|
||||
returns the Job object</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.jobprogress.job.NullJob">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.jobprogress.job.</code><code class="descname">NullJob</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.job.NullJob" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../util.html">hscommon.util</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="performer.html">hscommon.jobprogress.performer</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
92
help/en/developer/hscommon/jobprogress/performer.html
Normal file
92
help/en/developer/hscommon/jobprogress/performer.html
Normal file
@@ -0,0 +1,92 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.jobprogress.performer — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon.jobprogress.qt" href="qt.html" />
|
||||
<link rel="prev" title="hscommon.jobprogress.job" href="job.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.jobprogress.performer</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="job.html">hscommon.jobprogress.job</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="qt.html">hscommon.jobprogress.qt</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.jobprogress.performer">
|
||||
<span id="hscommon-jobprogress-performer"></span><h1>hscommon.jobprogress.performer<a class="headerlink" href="#module-hscommon.jobprogress.performer" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.jobprogress.performer.ThreadedJobPerformer" title="hscommon.jobprogress.performer.ThreadedJobPerformer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ThreadedJobPerformer</span></code></a></td>
|
||||
<td>Run threaded jobs and track progress.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.jobprogress.performer.ThreadedJobPerformer">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.jobprogress.performer.</code><code class="descname">ThreadedJobPerformer</code><a class="headerlink" href="#hscommon.jobprogress.performer.ThreadedJobPerformer" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Run threaded jobs and track progress.</p>
|
||||
<p>To run a threaded job, first create a job with _create_job(), then call _run_threaded(), with
|
||||
your work function as a parameter.</p>
|
||||
<p>Example:</p>
|
||||
<p>j = self._create_job()
|
||||
self._run_threaded(self.some_work_func, (arg1, arg2, j))</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.jobprogress.performer.ThreadedJobPerformer.reraise_if_error">
|
||||
<code class="descname">reraise_if_error</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.performer.ThreadedJobPerformer.reraise_if_error" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Reraises the error that happened in the thread if any.</p>
|
||||
<p>Call this after the caller of run_threaded detected that self._job_running returned to False</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="job.html">hscommon.jobprogress.job</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="qt.html">hscommon.jobprogress.qt</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
79
help/en/developer/hscommon/jobprogress/qt.html
Normal file
79
help/en/developer/hscommon/jobprogress/qt.html
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.jobprogress.qt — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<link rel="next" title="hscommon.gui.base" href="../gui/base.html" />
|
||||
<link rel="prev" title="hscommon.jobprogress.performer" href="performer.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.jobprogress.qt</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="performer.html">hscommon.jobprogress.performer</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="../gui/base.html">hscommon.gui.base</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.jobprogress.qt">
|
||||
<span id="hscommon-jobprogress-qt"></span><h1>hscommon.jobprogress.qt<a class="headerlink" href="#module-hscommon.jobprogress.qt" title="Permalink to this headline">¶</a></h1>
|
||||
<table border="1" class="longtable docutils">
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="90%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><a class="reference internal" href="#hscommon.jobprogress.qt.Progress" title="hscommon.jobprogress.qt.Progress"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Progress</span></code></a>(parent)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.jobprogress.qt.Progress">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.jobprogress.qt.</code><code class="descname">Progress</code><span class="sig-paren">(</span><em>parent</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.jobprogress.qt.Progress" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="performer.html">hscommon.jobprogress.performer</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="../gui/base.html">hscommon.gui.base</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
113
help/en/developer/hscommon/notify.html
Normal file
113
help/en/developer/hscommon/notify.html
Normal file
@@ -0,0 +1,113 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.notify — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="hscommon.path" href="path.html" />
|
||||
<link rel="prev" title="hscommon.desktop" href="desktop.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.notify</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="desktop.html">hscommon.desktop</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="path.html">hscommon.path</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.notify">
|
||||
<span id="hscommon-notify"></span><h1>hscommon.notify<a class="headerlink" href="#module-hscommon.notify" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Very simple inter-object notification system.</p>
|
||||
<p>This module is a brain-dead simple notification system involving a <a class="reference internal" href="#hscommon.notify.Broadcaster" title="hscommon.notify.Broadcaster"><code class="xref py py-class docutils literal notranslate"><span class="pre">Broadcaster</span></code></a> and a
|
||||
<a class="reference internal" href="#hscommon.notify.Listener" title="hscommon.notify.Listener"><code class="xref py py-class docutils literal notranslate"><span class="pre">Listener</span></code></a>. A listener can only listen to one broadcaster. A broadcaster can have multiple
|
||||
listeners. If the listener is connected, whenever the broadcaster calls <a class="reference internal" href="#hscommon.notify.Broadcaster.notify" title="hscommon.notify.Broadcaster.notify"><code class="xref py py-meth docutils literal notranslate"><span class="pre">notify()</span></code></a>,
|
||||
the method with the same name as the broadcasted message is called on the listener.</p>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.notify.Broadcaster">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.notify.</code><code class="descname">Broadcaster</code><a class="headerlink" href="#hscommon.notify.Broadcaster" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Broadcasts messages that are received by all listeners.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.notify.Broadcaster.notify">
|
||||
<code class="descname">notify</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.notify.Broadcaster.notify" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Notify all connected listeners of <code class="docutils literal notranslate"><span class="pre">msg</span></code>.</p>
|
||||
<p>That means that each listeners will have their method with the same name as <code class="docutils literal notranslate"><span class="pre">msg</span></code> called.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.notify.Listener">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.notify.</code><code class="descname">Listener</code><span class="sig-paren">(</span><em>broadcaster</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.notify.Listener" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A listener is initialized with the broadcaster it’s going to listen to. Initially, it is not connected.</p>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.notify.Listener.bind_messages">
|
||||
<code class="descname">bind_messages</code><span class="sig-paren">(</span><em>messages</em>, <em>func</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.notify.Listener.bind_messages" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Binds multiple message to the same function.</p>
|
||||
<p>Often, we perform the same thing on multiple messages. Instead of having the same function
|
||||
repeated again and agin in our class, we can use this method to bind multiple messages to
|
||||
the same function.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.notify.Listener.connect">
|
||||
<code class="descname">connect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.notify.Listener.connect" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Connects the listener to its broadcaster.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.notify.Listener.disconnect">
|
||||
<code class="descname">disconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.notify.Listener.disconnect" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Disconnects the listener from its broadcaster.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="hscommon.notify.Repeater">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.notify.</code><code class="descname">Repeater</code><span class="sig-paren">(</span><em>broadcaster</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.notify.Repeater" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="desktop.html">hscommon.desktop</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="path.html">hscommon.path</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
118
help/en/developer/hscommon/path.html
Normal file
118
help/en/developer/hscommon/path.html
Normal file
@@ -0,0 +1,118 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.path — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="hscommon.util" href="util.html" />
|
||||
<link rel="prev" title="hscommon.notify" href="notify.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.path</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="notify.html">hscommon.notify</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="util.html">hscommon.util</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.path">
|
||||
<span id="hscommon-path"></span><h1>hscommon.path<a class="headerlink" href="#module-hscommon.path" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.path.Path">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.path.</code><code class="descname">Path</code><a class="headerlink" href="#hscommon.path.Path" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A handy class to work with paths.</p>
|
||||
<p>We subclass <code class="docutils literal notranslate"><span class="pre">tuple</span></code>, each element of the tuple represents an element of the path.</p>
|
||||
<ul class="simple">
|
||||
<li><code class="docutils literal notranslate"><span class="pre">Path('/foo/bar/baz')[1]</span></code> –> <code class="docutils literal notranslate"><span class="pre">'bar'</span></code></li>
|
||||
<li><code class="docutils literal notranslate"><span class="pre">Path('/foo/bar/baz')[1:2]</span></code> –> <code class="docutils literal notranslate"><span class="pre">Path('bar/baz')</span></code></li>
|
||||
<li><code class="docutils literal notranslate"><span class="pre">Path('/foo/bar')['baz']</span></code> –> <code class="docutils literal notranslate"><span class="pre">Path('/foo/bar/baz')</span></code></li>
|
||||
<li><code class="docutils literal notranslate"><span class="pre">str(Path('/foo/bar/baz'))</span></code> –> <code class="docutils literal notranslate"><span class="pre">'/foo/bar/baz'</span></code></li>
|
||||
</ul>
|
||||
<dl class="method">
|
||||
<dt id="hscommon.path.Path.is_parent_of">
|
||||
<code class="descname">is_parent_of</code><span class="sig-paren">(</span><em>other</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.path.Path.is_parent_of" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Whether <code class="docutils literal notranslate"><span class="pre">other</span></code> is a subpath of <code class="docutils literal notranslate"><span class="pre">self</span></code>.</p>
|
||||
<p>Almost the same as <code class="docutils literal notranslate"><span class="pre">other</span> <span class="pre">in</span> <span class="pre">self</span></code>, but it’s a bit more self-explicative and when
|
||||
<code class="docutils literal notranslate"><span class="pre">other</span> <span class="pre">==</span> <span class="pre">self</span></code>, returns False.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="hscommon.path.Path.parent">
|
||||
<code class="descname">parent</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.path.Path.parent" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the parent path.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">Path('/foo/bar/baz').parent()</span></code> –> <code class="docutils literal notranslate"><span class="pre">Path('/foo/bar')</span></code></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="hscommon.path.Path.name">
|
||||
<code class="descname">name</code><a class="headerlink" href="#hscommon.path.Path.name" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Last element of the path (filename), with extension.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">Path('/foo/bar/baz').name</span></code> –> <code class="docutils literal notranslate"><span class="pre">'baz'</span></code></p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.path.log_io_error">
|
||||
<code class="descclassname">hscommon.path.</code><code class="descname">log_io_error</code><span class="sig-paren">(</span><em>func</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.path.log_io_error" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Catches OSError, IOError and WindowsError and log them</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.path.pathify">
|
||||
<code class="descclassname">hscommon.path.</code><code class="descname">pathify</code><span class="sig-paren">(</span><em>f</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.path.pathify" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Ensure that every annotated <a class="reference internal" href="#hscommon.path.Path" title="hscommon.path.Path"><code class="xref py py-class docutils literal notranslate"><span class="pre">Path</span></code></a> arguments are actually paths.</p>
|
||||
<p>When a function is decorated with <code class="docutils literal notranslate"><span class="pre">@pathify</span></code>, every argument with annotated as Path will be
|
||||
converted to a Path if it wasn’t already. Example:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@pathify</span>
|
||||
<span class="k">def</span> <span class="nf">foo</span><span class="p">(</span><span class="n">path</span><span class="p">:</span> <span class="n">Path</span><span class="p">,</span> <span class="n">otherarg</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">path</span><span class="o">.</span><span class="n">listdir</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Calling <code class="docutils literal notranslate"><span class="pre">foo('/bar',</span> <span class="pre">0)</span></code> will convert <code class="docutils literal notranslate"><span class="pre">'/bar'</span></code> to <code class="docutils literal notranslate"><span class="pre">Path('/bar')</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="notify.html">hscommon.notify</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="util.html">hscommon.util</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
289
help/en/developer/hscommon/util.html
Normal file
289
help/en/developer/hscommon/util.html
Normal file
@@ -0,0 +1,289 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>hscommon.util — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
<link rel="next" title="hscommon.jobprogress.job" href="jobprogress/job.html" />
|
||||
<link rel="prev" title="hscommon.path" href="path.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>hscommon.util</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="path.html">hscommon.path</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="jobprogress/job.html">hscommon.jobprogress.job</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="module-hscommon.util">
|
||||
<span id="hscommon-util"></span><h1>hscommon.util<a class="headerlink" href="#module-hscommon.util" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="class">
|
||||
<dt id="hscommon.util.FileOrPath">
|
||||
<em class="property">class </em><code class="descclassname">hscommon.util.</code><code class="descname">FileOrPath</code><span class="sig-paren">(</span><em>file_or_path</em>, <em>mode='rb'</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.FileOrPath" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Does the same as <a class="reference internal" href="#hscommon.util.open_if_filename" title="hscommon.util.open_if_filename"><code class="xref py py-func docutils literal notranslate"><span class="pre">open_if_filename()</span></code></a>, but it can be used with a <code class="docutils literal notranslate"><span class="pre">with</span></code> statement.</p>
|
||||
<p>Example:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">with</span> <span class="n">FileOrPath</span><span class="p">(</span><span class="n">infile</span><span class="p">):</span>
|
||||
<span class="n">dostuff</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.RE_INVALID_XML_SUB">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">RE_INVALID_XML_SUB</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.RE_INVALID_XML_SUB" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.allsame">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">allsame</code><span class="sig-paren">(</span><em>iterable</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.allsame" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns whether all elements of ‘iterable’ are the same.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.dedupe">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">dedupe</code><span class="sig-paren">(</span><em>iterable</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.dedupe" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a list of elements in <code class="docutils literal notranslate"><span class="pre">iterable</span></code> with all dupes removed.</p>
|
||||
<p>The order of the elements is preserved.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.delete_files_with_pattern">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">delete_files_with_pattern</code><span class="sig-paren">(</span><em>folder_path</em>, <em>pattern</em>, <em>recursive=True</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.delete_files_with_pattern" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Delete all files (or folders) in <cite>folder_path</cite> that match the glob <cite>pattern</cite>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.delete_if_empty">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">delete_if_empty</code><span class="sig-paren">(</span><em>path: hscommon.path.Path</em>, <em>files_to_delete=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.delete_if_empty" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Deletes the directory at ‘path’ if it is empty or if it only contains files_to_delete.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.ensure_file">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">ensure_file</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.ensure_file" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Create <cite>path</cite> as an empty file if it doesn’t exist.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.ensure_folder">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">ensure_folder</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.ensure_folder" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Create <cite>path</cite> as a folder if it doesn’t exist.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.escape">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">escape</code><span class="sig-paren">(</span><em>s</em>, <em>to_escape</em>, <em>escape_with='\\'</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.escape" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">s</span></code> with characters in <code class="docutils literal notranslate"><span class="pre">to_escape</span></code> all prepended with <code class="docutils literal notranslate"><span class="pre">escape_with</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.extract">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">extract</code><span class="sig-paren">(</span><em>predicate</em>, <em>iterable</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.extract" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Separates the wheat from the shaft (<cite>predicate</cite> defines what’s the wheat), and returns both.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.find_in_path">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">find_in_path</code><span class="sig-paren">(</span><em>name</em>, <em>paths=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.find_in_path" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Search for <cite>name</cite> in all directories of <cite>paths</cite> and return the absolute path of the first
|
||||
occurrence. If <cite>paths</cite> is None, $PATH is used.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.first">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">first</code><span class="sig-paren">(</span><em>iterable</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.first" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the first item of <code class="docutils literal notranslate"><span class="pre">iterable</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.flatten">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">flatten</code><span class="sig-paren">(</span><em>iterables</em>, <em>start_with=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.flatten" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Takes a list of lists <code class="docutils literal notranslate"><span class="pre">iterables</span></code> and returns a list containing elements of every list.</p>
|
||||
<p>If <code class="docutils literal notranslate"><span class="pre">start_with</span></code> is not <code class="docutils literal notranslate"><span class="pre">None</span></code>, the result will start with <code class="docutils literal notranslate"><span class="pre">start_with</span></code> items, exactly as
|
||||
if <code class="docutils literal notranslate"><span class="pre">start_with</span></code> would be the first item of lists.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.format_size">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">format_size</code><span class="sig-paren">(</span><em>size</em>, <em>decimal=0</em>, <em>forcepower=-1</em>, <em>showdesc=True</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.format_size" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Transform a byte count in a formatted string (KB, MB etc..).</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">size</span></code> is the number of bytes to format.
|
||||
<code class="docutils literal notranslate"><span class="pre">decimal</span></code> is the number digits after the dot.
|
||||
<code class="docutils literal notranslate"><span class="pre">forcepower</span></code> is the desired suffix. 0 is B, 1 is KB, 2 is MB etc.. if kept at -1, the suffix
|
||||
will be automatically chosen (so the resulting number is always below 1024).
|
||||
if <code class="docutils literal notranslate"><span class="pre">showdesc</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code>, the suffix will be shown after the number.
|
||||
Usage example:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">format_size</span><span class="p">(</span><span class="mi">1234</span><span class="p">,</span> <span class="n">decimal</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">showdesc</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
<span class="go">'1.21 KB'</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.format_time">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">format_time</code><span class="sig-paren">(</span><em>seconds</em>, <em>with_hours=True</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.format_time" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Transforms seconds in a hh:mm:ss string.</p>
|
||||
<p>If <code class="docutils literal notranslate"><span class="pre">with_hours</span></code> if false, the format is mm:ss.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.format_time_decimal">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">format_time_decimal</code><span class="sig-paren">(</span><em>seconds</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.format_time_decimal" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Transforms seconds in a strings like ‘3.4 minutes’.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.get_file_ext">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">get_file_ext</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.get_file_ext" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the lowercase extension part of filename, without the dot.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.iterconsume">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">iterconsume</code><span class="sig-paren">(</span><em>seq</em>, <em>reverse=True</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.iterconsume" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Iterate over <code class="docutils literal notranslate"><span class="pre">seq</span></code> and pops yielded objects.</p>
|
||||
<p>Because we use the <code class="docutils literal notranslate"><span class="pre">pop()</span></code> method, we reverse <code class="docutils literal notranslate"><span class="pre">seq</span></code> before proceeding. If you don’t need
|
||||
to do that, set <code class="docutils literal notranslate"><span class="pre">reverse</span></code> to <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p>
|
||||
<p>This is useful in tight memory situation where you are looping over a sequence of objects that
|
||||
are going to be discarded afterwards. If you’re creating other objects during that iteration
|
||||
you might want to use this to avoid <code class="docutils literal notranslate"><span class="pre">MemoryError</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.iterdaterange">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">iterdaterange</code><span class="sig-paren">(</span><em>start</em>, <em>end</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.iterdaterange" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Yields every day between <code class="docutils literal notranslate"><span class="pre">start</span></code> and <code class="docutils literal notranslate"><span class="pre">end</span></code>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.minmax">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">minmax</code><span class="sig-paren">(</span><em>value</em>, <em>min_value</em>, <em>max_value</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.minmax" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns <cite>value</cite> or one of the min/max bounds if <cite>value</cite> is not between them.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.modified_after">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">modified_after</code><span class="sig-paren">(</span><em>first_path: hscommon.path.Path</em>, <em>second_path: hscommon.path.Path</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.modified_after" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">True</span></code> if first_path’s mtime is higher than second_path’s mtime.</p>
|
||||
<p>If one of the files doesn’t exist or is <code class="docutils literal notranslate"><span class="pre">None</span></code>, it is considered “never modified”.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.multi_replace">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">multi_replace</code><span class="sig-paren">(</span><em>s</em>, <em>replace_from</em>, <em>replace_to=''</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.multi_replace" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A function like str.replace() with multiple replacements.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">replace_from</span></code> is a list of things you want to replace. Ex: [‘a’,’bc’,’d’]
|
||||
<code class="docutils literal notranslate"><span class="pre">replace_to</span></code> is a list of what you want to replace to.
|
||||
If <code class="docutils literal notranslate"><span class="pre">replace_to</span></code> is a list and has the same length as <code class="docutils literal notranslate"><span class="pre">replace_from</span></code>, <code class="docutils literal notranslate"><span class="pre">replace_from</span></code>
|
||||
items will be translated to corresponding <code class="docutils literal notranslate"><span class="pre">replace_to</span></code>. A <code class="docutils literal notranslate"><span class="pre">replace_to</span></code> list must
|
||||
have the same length as <code class="docutils literal notranslate"><span class="pre">replace_from</span></code>
|
||||
If <code class="docutils literal notranslate"><span class="pre">replace_to</span></code> is a string, all <code class="docutils literal notranslate"><span class="pre">replace_from</span></code> occurence will be replaced
|
||||
by that string.
|
||||
<code class="docutils literal notranslate"><span class="pre">replace_from</span></code> can also be a str. If it is, every char in it will be translated
|
||||
as if <code class="docutils literal notranslate"><span class="pre">replace_from</span></code> would be a list of chars. If <code class="docutils literal notranslate"><span class="pre">replace_to</span></code> is a str and has
|
||||
the same length as <code class="docutils literal notranslate"><span class="pre">replace_from</span></code>, it will be transformed into a list.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.nonone">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">nonone</code><span class="sig-paren">(</span><em>value</em>, <em>replace_value</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.nonone" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns <code class="docutils literal notranslate"><span class="pre">value</span></code> if <code class="docutils literal notranslate"><span class="pre">value</span></code> is not <code class="docutils literal notranslate"><span class="pre">None</span></code>. Returns <code class="docutils literal notranslate"><span class="pre">replace_value</span></code> otherwise.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.open_if_filename">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">open_if_filename</code><span class="sig-paren">(</span><em>infile</em>, <em>mode='rb'</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.open_if_filename" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>If <code class="docutils literal notranslate"><span class="pre">infile</span></code> is a string, it opens and returns it. If it’s already a file object, it simply returns it.</p>
|
||||
<p>This function returns <code class="docutils literal notranslate"><span class="pre">(file,</span> <span class="pre">should_close_flag)</span></code>. The should_close_flag is True is a file has
|
||||
effectively been opened (if we already pass a file object, we assume that the responsibility for
|
||||
closing the file has already been taken). Example usage:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fp</span><span class="p">,</span> <span class="n">shouldclose</span> <span class="o">=</span> <span class="n">open_if_filename</span><span class="p">(</span><span class="n">infile</span><span class="p">)</span>
|
||||
<span class="n">dostuff</span><span class="p">()</span>
|
||||
<span class="k">if</span> <span class="n">shouldclose</span><span class="p">:</span>
|
||||
<span class="n">fp</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.pluralize">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">pluralize</code><span class="sig-paren">(</span><em>number</em>, <em>word</em>, <em>decimals=0</em>, <em>plural_word=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.pluralize" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a pluralized string with <code class="docutils literal notranslate"><span class="pre">number</span></code> in front of <code class="docutils literal notranslate"><span class="pre">word</span></code>.</p>
|
||||
<p>Adds a ‘s’ to s if <code class="docutils literal notranslate"><span class="pre">number</span></code> > 1.
|
||||
<code class="docutils literal notranslate"><span class="pre">number</span></code>: The number to go in front of s
|
||||
<code class="docutils literal notranslate"><span class="pre">word</span></code>: The word to go after number
|
||||
<code class="docutils literal notranslate"><span class="pre">decimals</span></code>: The number of digits after the dot
|
||||
<code class="docutils literal notranslate"><span class="pre">plural_word</span></code>: If the plural rule for word is more complex than adding a ‘s’, specify a plural</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.rem_file_ext">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">rem_file_ext</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.rem_file_ext" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the filename without extension.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.stripfalse">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">stripfalse</code><span class="sig-paren">(</span><em>seq</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.stripfalse" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a sequence with all false elements stripped out of seq.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.trailiter">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">trailiter</code><span class="sig-paren">(</span><em>iterable</em>, <em>skipfirst=False</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.trailiter" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Yields (prev_element, element), starting with (None, first_element).</p>
|
||||
<p>If skipfirst is True, there will be no (None, item1) element and we’ll start
|
||||
directly with (item1, item2).</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="hscommon.util.tryint">
|
||||
<code class="descclassname">hscommon.util.</code><code class="descname">tryint</code><span class="sig-paren">(</span><em>value</em>, <em>default=0</em><span class="sig-paren">)</span><a class="headerlink" href="#hscommon.util.tryint" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Tries to convert <code class="docutils literal notranslate"><span class="pre">value</span></code> to in <code class="docutils literal notranslate"><span class="pre">int</span></code> and returns <code class="docutils literal notranslate"><span class="pre">default</span></code> if it fails.</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="path.html">hscommon.path</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="jobprogress/job.html">hscommon.jobprogress.job</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
149
help/en/developer/index.html
Normal file
149
help/en/developer/index.html
Normal file
@@ -0,0 +1,149 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Developer Guide — dupeGuru 4.0.3 documentation</title>
|
||||
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../_static/documentation_options.js"></script>
|
||||
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="../_static/translations.js"></script>
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="core" href="core/index.html" />
|
||||
<link rel="prev" title="Frequently Asked Questions" href="../faq.html" />
|
||||
</head><body>
|
||||
<div class="header" role="banner"><h1 class="heading"><a href="../index.html">
|
||||
<span>dupeGuru 4.0.3 documentation</span></a></h1>
|
||||
<h2 class="heading"><span>Developer Guide</span></h2>
|
||||
</div>
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../faq.html">Frequently Asked Questions</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="core/index.html">core</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
|
||||
<div class="section" id="developer-guide">
|
||||
<h1>Developer Guide<a class="headerlink" href="#developer-guide" title="Permalink to this headline">¶</a></h1>
|
||||
<p>When looking at a non-trivial codebase for the first time, it’s very difficult to understand
|
||||
anything of it until you get the “Big Picture”. This page is meant to, hopefully, make you get
|
||||
dupeGuru’s big picture.</p>
|
||||
<div class="section" id="branches-and-tags">
|
||||
<h2>Branches and tags<a class="headerlink" href="#branches-and-tags" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The git repo has one main branch, <code class="docutils literal notranslate"><span class="pre">master</span></code>. It represents the latest “stable development commit”,
|
||||
that is, the latest commit that doesn’t include in-progress features. This branch should always
|
||||
be buildable, <code class="docutils literal notranslate"><span class="pre">tox</span></code> should always run without errors on it.</p>
|
||||
<p>When a feature/bugfix has an atomicity of a single commit, it’s alright to commit right into
|
||||
<code class="docutils literal notranslate"><span class="pre">master</span></code>. However, if a feature/bugfix needs more than a commit, it should live in a separate
|
||||
topic branch until it’s ready.</p>
|
||||
<p>Every release is tagged with the version number. For example, there’s a <code class="docutils literal notranslate"><span class="pre">2.8.2</span></code> tag for the
|
||||
v2.8.2 release.</p>
|
||||
</div>
|
||||
<div class="section" id="model-view-controller-nope">
|
||||
<h2>Model/View/Controller… nope!<a class="headerlink" href="#model-view-controller-nope" title="Permalink to this headline">¶</a></h2>
|
||||
<p>dupeGuru’s codebase has quite a few design flaws. The Model, View and Controller roles are filled by
|
||||
different classes, scattered around. If you’re aware of that, it might help you to understand what
|
||||
the heck is going on.</p>
|
||||
<p>The central piece of dupeGuru is <a class="reference internal" href="core/app.html#core.app.DupeGuru" title="core.app.DupeGuru"><code class="xref py py-class docutils literal notranslate"><span class="pre">core.app.DupeGuru</span></code></a>. It’s the only
|
||||
interface to the python’s code for the GUI code. A duplicate scan is started with
|
||||
<a class="reference internal" href="core/app.html#core.app.DupeGuru.start_scanning" title="core.app.DupeGuru.start_scanning"><code class="xref py py-meth docutils literal notranslate"><span class="pre">core.app.DupeGuru.start_scanning()</span></code></a>, directories are added through
|
||||
<a class="reference internal" href="core/app.html#core.app.DupeGuru.add_directory" title="core.app.DupeGuru.add_directory"><code class="xref py py-meth docutils literal notranslate"><span class="pre">core.app.DupeGuru.add_directory()</span></code></a>, etc..</p>
|
||||
<p>A lot of functionalities of the App are implemented in the platform-specific subclasses of
|
||||
<a class="reference internal" href="core/app.html#core.app.DupeGuru" title="core.app.DupeGuru"><code class="xref py py-class docutils literal notranslate"><span class="pre">core.app.DupeGuru</span></code></a>, like <code class="docutils literal notranslate"><span class="pre">DupeGuru</span></code> in <code class="docutils literal notranslate"><span class="pre">cocoa/inter/app.py</span></code>, or the <code class="docutils literal notranslate"><span class="pre">DupeGuru</span></code> class
|
||||
in <code class="docutils literal notranslate"><span class="pre">qt/base/app.py</span></code>. For example, when performing “Remove Selected From Results”,
|
||||
<code class="docutils literal notranslate"><span class="pre">RemoveSelected()</span></code> on the cocoa side, and <code class="docutils literal notranslate"><span class="pre">remove_duplicates()</span></code> on the PyQt side, are
|
||||
respectively called to perform the thing.</p>
|
||||
</div>
|
||||
<div class="section" id="jobs">
|
||||
<span id="id1"></span><h2>Jobs<a class="headerlink" href="#jobs" title="Permalink to this headline">¶</a></h2>
|
||||
<p>A lot of operations in dupeGuru take a significant amount of time. This is why there’s a generalized
|
||||
threaded job mechanism built-in <a class="reference internal" href="core/app.html#core.app.DupeGuru" title="core.app.DupeGuru"><code class="xref py py-class docutils literal notranslate"><span class="pre">DupeGuru</span></code></a>. First, <a class="reference internal" href="core/app.html#core.app.DupeGuru" title="core.app.DupeGuru"><code class="xref py py-class docutils literal notranslate"><span class="pre">DupeGuru</span></code></a> has
|
||||
a <code class="docutils literal notranslate"><span class="pre">progress</span></code> member which is an instance of
|
||||
<a class="reference internal" href="hscommon/jobprogress/performer.html#hscommon.jobprogress.performer.ThreadedJobPerformer" title="hscommon.jobprogress.performer.ThreadedJobPerformer"><code class="xref py py-class docutils literal notranslate"><span class="pre">ThreadedJobPerformer</span></code></a>. It lets the GUI code know of the progress
|
||||
of the current threaded job. When <a class="reference internal" href="core/app.html#core.app.DupeGuru" title="core.app.DupeGuru"><code class="xref py py-class docutils literal notranslate"><span class="pre">DupeGuru</span></code></a> needs to start a job, it calls
|
||||
<code class="docutils literal notranslate"><span class="pre">_start_job()</span></code> and the platform specific subclass deals with the details of starting the job.</p>
|
||||
</div>
|
||||
<div class="section" id="core-principles">
|
||||
<h2>Core principles<a class="headerlink" href="#core-principles" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The core of the duplicate matching takes place (for SE and ME, not PE) in <a class="reference internal" href="core/engine.html#module-core.engine" title="core.engine"><code class="xref py py-mod docutils literal notranslate"><span class="pre">core.engine</span></code></a>.
|
||||
There’s <a class="reference internal" href="core/engine.html#core.engine.getmatches" title="core.engine.getmatches"><code class="xref py py-func docutils literal notranslate"><span class="pre">core.engine.getmatches()</span></code></a> which take a list of <a class="reference internal" href="core/fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">core.fs.File</span></code></a> instances and
|
||||
return a list of <code class="docutils literal notranslate"><span class="pre">(firstfile,</span> <span class="pre">secondfile,</span> <span class="pre">match_percentage)</span></code> matches. Then, there’s
|
||||
<a class="reference internal" href="core/engine.html#core.engine.get_groups" title="core.engine.get_groups"><code class="xref py py-func docutils literal notranslate"><span class="pre">core.engine.get_groups()</span></code></a> which takes a list of matches and returns a list of
|
||||
<a class="reference internal" href="core/engine.html#core.engine.Group" title="core.engine.Group"><code class="xref py py-class docutils literal notranslate"><span class="pre">Group</span></code></a> instances (a <a class="reference internal" href="core/engine.html#core.engine.Group" title="core.engine.Group"><code class="xref py py-class docutils literal notranslate"><span class="pre">Group</span></code></a> is basically a list of <a class="reference internal" href="core/fs.html#core.fs.File" title="core.fs.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> matching
|
||||
together).</p>
|
||||
<p>When a scan is over, the final result (the list of groups from <a class="reference internal" href="core/engine.html#core.engine.get_groups" title="core.engine.get_groups"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_groups()</span></code></a>) is placed into
|
||||
<a class="reference internal" href="core/app.html#core.app.DupeGuru.results" title="core.app.DupeGuru.results"><code class="xref py py-attr docutils literal notranslate"><span class="pre">core.app.DupeGuru.results</span></code></a>, which is a <a class="reference internal" href="core/results.html#core.results.Results" title="core.results.Results"><code class="xref py py-class docutils literal notranslate"><span class="pre">core.results.Results</span></code></a> instance. The
|
||||
<a class="reference internal" href="core/results.html#core.results.Results" title="core.results.Results"><code class="xref py py-class docutils literal notranslate"><span class="pre">Results</span></code></a> instance is where all the dupe marking, sorting, removing, power marking, etc.
|
||||
takes place.</p>
|
||||
</div>
|
||||
<div class="section" id="api">
|
||||
<h2>API<a class="headerlink" href="#api" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="core/index.html">core</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="core/app.html">core.app</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="core/fs.html">core.fs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="core/engine.html">core.engine</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="core/directories.html">core.directories</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="core/results.html">core.results</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="core/gui/index.html">core.gui</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="hscommon/index.html">hscommon</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/build.html">hscommon.build</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/conflict.html">hscommon.conflict</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/desktop.html">hscommon.desktop</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/notify.html">hscommon.notify</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/path.html">hscommon.path</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/util.html">hscommon.util</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/jobprogress/job.html">hscommon.jobprogress.job</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/jobprogress/performer.html">hscommon.jobprogress.performer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/jobprogress/qt.html">hscommon.jobprogress.qt</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/gui/base.html">hscommon.gui.base</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/gui/column.html">hscommon.gui.column</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/gui/progress_window.html">hscommon.gui.progress_window</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/gui/selectable_list.html">hscommon.gui.selectable_list</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/gui/table.html">hscommon.gui.table</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/gui/text_field.html">hscommon.gui.text_field</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="hscommon/gui/tree.html">hscommon.gui.tree</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
|
||||
<p>
|
||||
«  <a href="../faq.html">Frequently Asked Questions</a>
|
||||
  ::  
|
||||
<a class="uplink" href="../index.html">Contents</a>
|
||||
  ::  
|
||||
<a href="core/index.html">core</a>  »
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2016, Hardcoded Software.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user