Skip to content

Commit

Permalink
Docs update and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Cimbali committed Jan 7, 2018
1 parent 2242582 commit a89d51e
Show file tree
Hide file tree
Showing 28 changed files with 2,698 additions and 2,635 deletions.
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: d3fb11fa7b8483d4c0ac5f94c441d84d
config: 1aa90593e506b555eb9e0f7a666a4bf2
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'b&#39;0.6-242-gb240e7c&#39;',
VERSION:'b&#39;0.6-250-g2242582&#39;',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
Expand Down
90 changes: 36 additions & 54 deletions docs/_modules/gi/overrides/Gdk.html

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,14 @@
<div itemprop="articleBody">

<h1>All modules for which code is available</h1>
<ul><li><a href="ctypes.html">ctypes</a></li>
<li><a href="gi/overrides/Gdk.html">gi.overrides.Gdk</a></li>
<ul><li><a href="gi/overrides/Gdk.html">gi.overrides.Gdk</a></li>
<li><a href="gi/repository/GdkPixbuf.html">gi.repository.GdkPixbuf</a></li>
<li><a href="gi/repository/Gtk.html">gi.repository.Gtk</a></li>
<li><a href="pympress/builder.html">pympress.builder</a></li>
<li><a href="pympress/callbacks.html">pympress.callbacks</a></li>
<li><a href="pympress/config.html">pympress.config</a></li>
<li><a href="pympress/document.html">pympress.document</a></li>
<li><a href="pympress/editable_label.html">pympress.editable_label</a></li>
<li><a href="pympress/extras.html">pympress.extras</a></li>
<li><a href="pympress/page_number.html">pympress.page_number</a></li>
<li><a href="pympress/pointer.html">pympress.pointer</a></li>
<li><a href="pympress/scribble.html">pympress.scribble</a></li>
<li><a href="pympress/surfacecache.html">pympress.surfacecache</a></li>
Expand Down Expand Up @@ -209,7 +206,7 @@ <h1>All modules for which code is available</h1>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'b&#39;0.6-242-gb240e7c&#39;',
VERSION:'b&#39;0.6-250-g2242582&#39;',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
Expand Down
45 changes: 29 additions & 16 deletions docs/_modules/pympress/builder.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@
<div itemprop="articleBody">

<h1>Source code for pympress.builder</h1><div class="highlight"><pre>
<span></span><span class="c1"># generic_ui.py</span>
<span></span><span class="c1"># -*- coding: utf-8 -*-</span>
<span class="c1">#</span>
<span class="c1"># builder.py</span>
<span class="c1">#</span>
<span class="c1"># Copyright 2017 Cimbali &lt;me@cimba.li&gt;</span>
<span class="c1">#</span>
Expand Down Expand Up @@ -185,7 +187,7 @@ <h1>Source code for pympress.builder</h1><div class="highlight"><pre>
<span class="sd">to avoid dealing with all the mess of C/GNU gettext&#39;s bad portability.</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">print_function</span>
<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">print_function</span><span class="p">,</span> <span class="n">unicode_literals</span>

<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
Expand Down Expand Up @@ -239,8 +241,9 @@ <h1>Source code for pympress.builder</h1><div class="highlight"><pre>
<span class="n">Builder</span><span class="o">.</span><span class="n">__recursive_translate_widgets</span><span class="p">(</span><span class="n">a_widget</span><span class="o">.</span><span class="n">get_submenu</span><span class="p">())</span>


<div class="viewcode-block" id="Builder.signal_resolver"><a class="viewcode-back" href="../../pympress.html#pympress.builder.Builder.signal_resolver">[docs]</a> <span class="k">def</span> <span class="nf">signal_resolver</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attr_list</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Dynamically resolves a signal that is self.a.b.c() when attr_list is [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;].</span>
<div class="viewcode-block" id="Builder.signal_resolver"><a class="viewcode-back" href="../../pympress.html#pympress.builder.Builder.signal_resolver">[docs]</a> <span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">signal_resolver</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">attr_list</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Dynamically resolves a signal that is target.a.b.c() when attr_list is [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;].</span>

<span class="sd"> This allows to specify multi-level signals in the XML files, instead of targeting everything at the main UI object.</span>

Expand All @@ -254,18 +257,21 @@ <h1>Source code for pympress.builder</h1><div class="highlight"><pre>
<span class="sd"> Returns:</span>
<span class="sd"> function: The function to which we want to connect</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">target</span> <span class="o">=</span> <span class="bp">self</span>
<span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="n">attr_list</span><span class="p">:</span>
<span class="n">top</span> <span class="o">=</span> <span class="n">target</span>

<span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="n">attr_list</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">target</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">attr</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">AttributeError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s1">&#39;Can not reach target of signal </span><span class="si">{}</span><span class="s1">.</span><span class="si">{}</span><span class="s1">()&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">top</span><span class="p">,</span> <span class="s1">&#39;.&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">attr_list</span><span class="p">)),</span> <span class="n">exc_info</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span>
<span class="n">target</span> <span class="o">=</span> <span class="kc">None</span>

<span class="k">return</span> <span class="n">target</span>
<span class="k">return</span> <span class="n">target</span></div>

<span class="k">except</span> <span class="ne">AttributeError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s1">&#39;Can not reach target of signal </span><span class="si">{}</span><span class="s1">.</span><span class="si">{}</span><span class="s1">()&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s1">&#39;.&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">attr_list</span><span class="p">)),</span> <span class="n">exc_info</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span></div>


<div class="viewcode-block" id="Builder.get_callback_handler"><a class="viewcode-back" href="../../pympress.html#pympress.builder.Builder.get_callback_handler">[docs]</a> <span class="k">def</span> <span class="nf">get_callback_handler</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler_name</span><span class="p">):</span>
<div class="viewcode-block" id="Builder.find_callback_handler"><a class="viewcode-back" href="../../pympress.html#pympress.builder.Builder.find_callback_handler">[docs]</a> <span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">find_callback_handler</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">handler_name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Returns the handler its name. Parse handler names and split on &#39;.&#39; to use some level of recursion.</span>

<span class="sd"> Args:</span>
Expand All @@ -275,7 +281,7 @@ <h1>Source code for pympress.builder</h1><div class="highlight"><pre>
<span class="sd"> `function`: A function bound to an object or, if the object may change, a lambda calling Builder.signal_resolver to get said function bound to an object</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler_name</span><span class="p">)</span>
<span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">handler_name</span><span class="p">)</span>

<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
<span class="n">attr_list</span> <span class="o">=</span> <span class="n">handler_name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)</span>
Expand All @@ -284,11 +290,18 @@ <h1>Source code for pympress.builder</h1><div class="highlight"><pre>
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s1">&#39;Handler name not in target object. Expected &quot;.&quot; but got: </span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">handler_name</span><span class="p">),</span> <span class="n">exc_info</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span>
<span class="k">raise</span>

<span class="c1"># Dynamically resolved handler for &#39;doc&#39; (only) since self.doc may change</span>
<span class="c1"># Dynamically resolved handler for &#39;doc&#39; (only) since target.doc may change</span>
<span class="k">if</span> <span class="s1">&#39;doc&#39;</span> <span class="ow">in</span> <span class="n">attr_list</span><span class="p">:</span>
<span class="k">return</span> <span class="k">lambda</span> <span class="o">*</span><span class="n">args</span><span class="p">:</span> <span class="n">Builder</span><span class="o">.</span><span class="n">signal_resolver</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attr_list</span><span class="p">)(</span><span class="o">*</span><span class="n">args</span><span class="p">)</span>
<span class="k">return</span> <span class="k">lambda</span> <span class="o">*</span><span class="n">args</span><span class="p">:</span> <span class="n">Builder</span><span class="o">.</span><span class="n">signal_resolver</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">attr_list</span><span class="p">)(</span><span class="o">*</span><span class="n">args</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="n">Builder</span><span class="o">.</span><span class="n">signal_resolver</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attr_list</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">Builder</span><span class="o">.</span><span class="n">signal_resolver</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">attr_list</span><span class="p">)</span></div>


<div class="viewcode-block" id="Builder.get_callback_handler"><a class="viewcode-back" href="../../pympress.html#pympress.builder.Builder.get_callback_handler">[docs]</a> <span class="k">def</span> <span class="nf">get_callback_handler</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler_name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Convenience non-static wrapper function for :func:`find_callback_handler` to serch in the builder object.</span>

<span class="sd"> &quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">Builder</span><span class="o">.</span><span class="n">find_callback_handler</span><span class="o">.</span><span class="vm">__doc__</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">find_callback_handler</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler_name</span><span class="p">)</span></div>


<div class="viewcode-block" id="Builder.signal_connector"><a class="viewcode-back" href="../../pympress.html#pympress.builder.Builder.signal_connector">[docs]</a> <span class="k">def</span> <span class="nf">signal_connector</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">builder</span><span class="p">,</span> <span class="nb">object</span><span class="p">,</span> <span class="n">signal_name</span><span class="p">,</span> <span class="n">handler_name</span><span class="p">,</span> <span class="n">connect_object</span><span class="p">,</span> <span class="n">flags</span><span class="p">,</span> <span class="o">*</span><span class="n">user_data</span><span class="p">):</span>
Expand Down Expand Up @@ -516,7 +529,7 @@ <h1>Source code for pympress.builder</h1><div class="highlight"><pre>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../',
VERSION:'b&#39;0.6-242-gb240e7c&#39;',
VERSION:'b&#39;0.6-250-g2242582&#39;',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
Expand Down
8 changes: 5 additions & 3 deletions docs/_modules/pympress/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@
<div itemprop="articleBody">

<h1>Source code for pympress.config</h1><div class="highlight"><pre>
<span></span><span class="c1"># config.py</span>
<span></span><span class="c1"># -*- coding: utf-8 -*-</span>
<span class="c1">#</span>
<span class="c1"># config.py</span>
<span class="c1">#</span>
<span class="c1"># Copyright 2017 Cimbali &lt;me@cimba.li&gt;</span>
<span class="c1">#</span>
Expand All @@ -182,7 +184,7 @@ <h1>Source code for pympress.config</h1><div class="highlight"><pre>

<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">print_function</span>
<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">print_function</span><span class="p">,</span> <span class="n">unicode_literals</span>

<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
Expand Down Expand Up @@ -549,7 +551,7 @@ <h1>Source code for pympress.config</h1><div class="highlight"><pre>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../',
VERSION:'b&#39;0.6-242-gb240e7c&#39;',
VERSION:'b&#39;0.6-250-g2242582&#39;',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
Expand Down
8 changes: 5 additions & 3 deletions docs/_modules/pympress/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@
<div itemprop="articleBody">

<h1>Source code for pympress.document</h1><div class="highlight"><pre>
<span></span><span class="c1"># document.py</span>
<span></span><span class="c1"># -*- coding: utf-8 -*-</span>
<span class="c1">#</span>
<span class="c1"># document.py</span>
<span class="c1">#</span>
<span class="c1"># Copyright 2009, 2010 Thomas Jost &lt;thomas.jost@gmail.com&gt;</span>
<span class="c1"># Copyright 2015 Cimbali &lt;me@cimba.li&gt;</span>
Expand Down Expand Up @@ -191,7 +193,7 @@ <h1>Source code for pympress.document</h1><div class="highlight"><pre>
<span class="sd">elsewhere).</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">print_function</span>
<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">print_function</span><span class="p">,</span> <span class="n">unicode_literals</span>

<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
Expand Down Expand Up @@ -1018,7 +1020,7 @@ <h1>Source code for pympress.document</h1><div class="highlight"><pre>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../',
VERSION:'b&#39;0.6-242-gb240e7c&#39;',
VERSION:'b&#39;0.6-250-g2242582&#39;',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
Expand Down
Loading

0 comments on commit a89d51e

Please sign in to comment.