docs/build/html/pyams_utils.html
changeset 79 e12e18e99a68
parent 78 54aeb42c0d80
child 80 137705383aaf
--- a/docs/build/html/pyams_utils.html	Tue Nov 22 21:35:46 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2260 +0,0 @@
-<!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">
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    
-    <title>pyams_utils package &#8212; PyAMS_utils 0.1.4 documentation</title>
-    
-    <link rel="stylesheet" href="_static/pyramid.css" type="text/css" />
-    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-    
-    <script type="text/javascript">
-      var DOCUMENTATION_OPTIONS = {
-        URL_ROOT:    './',
-        VERSION:     '0.1.4',
-        COLLAPSE_INDEX: false,
-        FILE_SUFFIX: '.html',
-        HAS_SOURCE:  true
-      };
-    </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>
-    <link rel="index" title="Index" href="genindex.html" />
-    <link rel="search" title="Search" href="search.html" />
-    <link rel="top" title="PyAMS_utils 0.1.4 documentation" href="index.html" />
-<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Neuton&amp;subset=latin" type="text/css" media="screen" charset="utf-8" />
-<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nobile:regular,italic,bold,bolditalic&amp;subset=latin" type="text/css" media="screen" charset="utf-8" />
-<!--[if lte IE 6]>
-<link rel="stylesheet" href="_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
-<![endif]-->
-
-  </head>
-  <body role="document">
-
-    <div class="related" role="navigation" aria-label="related navigation">
-      <h3>Navigation</h3>
-      <ul>
-        <li class="right" style="margin-right: 10px">
-          <a href="genindex.html" title="General Index"
-             accesskey="I">index</a></li>
-        <li class="right" >
-          <a href="py-modindex.html" title="Python Module Index"
-             >modules</a> |</li>
-        <li class="nav-item nav-item-0"><a href="index.html">PyAMS_utils 0.1.4 documentation</a> &#187;</li> 
-      </ul>
-    </div>  
-
-    <div class="document">
-      <div class="documentwrapper">
-        <div class="bodywrapper">
-          <div class="body" role="main">
-            
-  <div class="section" id="pyams-utils-package">
-<h1>pyams_utils package<a class="headerlink" href="#pyams-utils-package" title="Permalink to this headline">¶</a></h1>
-<div class="section" id="subpackages">
-<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h2>
-<div class="toctree-wrapper compound">
-<ul>
-<li class="toctree-l1"><a class="reference internal" href="pyams_utils.interfaces.html">pyams_utils.interfaces package</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#submodules">Submodules</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.data">pyams_utils.interfaces.data module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.intids">pyams_utils.interfaces.intids module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.site">pyams_utils.interfaces.site module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.size">pyams_utils.interfaces.size module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.tales">pyams_utils.interfaces.tales module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.text">pyams_utils.interfaces.text module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.timezone">pyams_utils.interfaces.timezone module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.traversing">pyams_utils.interfaces.traversing module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.tree">pyams_utils.interfaces.tree module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces.zeo">pyams_utils.interfaces.zeo module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.interfaces.html#module-pyams_utils.interfaces">Module contents</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="pyams_utils.protocol.html">pyams_utils.protocol package</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.protocol.html#submodules">Submodules</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.protocol.html#module-pyams_utils.protocol.http">pyams_utils.protocol.http module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.protocol.html#module-pyams_utils.protocol.xmlrpc">pyams_utils.protocol.xmlrpc module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.protocol.html#module-pyams_utils.protocol">Module contents</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="pyams_utils.scripts.html">pyams_utils.scripts package</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.scripts.html#submodules">Submodules</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.scripts.html#module-pyams_utils.scripts.zodb">pyams_utils.scripts.zodb module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.scripts.html#module-pyams_utils.scripts">Module contents</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="pyams_utils.tests.html">pyams_utils.tests package</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.tests.html#submodules">Submodules</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.tests.html#module-pyams_utils.tests.test_utilsdocs">pyams_utils.tests.test_utilsdocs module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.tests.html#module-pyams_utils.tests.test_utilsdocstrings">pyams_utils.tests.test_utilsdocstrings module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.tests.html#module-pyams_utils.tests">Module contents</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="pyams_utils.timezone.html">pyams_utils.timezone package</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.timezone.html#submodules">Submodules</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.timezone.html#module-pyams_utils.timezone.utility">pyams_utils.timezone.utility module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.timezone.html#module-pyams_utils.timezone.vocabulary">pyams_utils.timezone.vocabulary module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.timezone.html#module-pyams_utils.timezone">Module contents</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="pyams_utils.widget.html">pyams_utils.widget package</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.widget.html#submodules">Submodules</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.widget.html#module-pyams_utils.widget.decimal">pyams_utils.widget.decimal module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.widget.html#module-pyams_utils.widget">Module contents</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="pyams_utils.zmi.html">pyams_utils.zmi package</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.zmi.html#submodules">Submodules</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.zmi.html#module-pyams_utils.zmi.intids">pyams_utils.zmi.intids module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.zmi.html#module-pyams_utils.zmi.timezone">pyams_utils.zmi.timezone module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.zmi.html#module-pyams_utils.zmi.zeo">pyams_utils.zmi.zeo module</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pyams_utils.zmi.html#module-pyams_utils.zmi">Module contents</a></li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-<div class="section" id="submodules">
-<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
-</div>
-<div class="section" id="module-pyams_utils.adapter">
-<span id="pyams-utils-adapter-module"></span><h2>pyams_utils.adapter module<a class="headerlink" href="#module-pyams_utils.adapter" title="Permalink to this headline">¶</a></h2>
-<p>Adapters management package</p>
-<p>This package provides a small set of standard base adapters for <em>context</em>, <em>context</em> and <em>request</em>, and
-<em>context</em> and <em>request</em> and <em>view</em>.</p>
-<p>See <a class="reference internal" href="zca.html#zca"><span class="std std-ref">Managing ZCA with PyAMS</span></a> to see how PyAMS can help components management.</p>
-<dl class="class">
-<dt id="pyams_utils.adapter.ContextAdapter">
-<em class="property">class </em><code class="descclassname">pyams_utils.adapter.</code><code class="descname">ContextAdapter</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.adapter.ContextAdapter" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Context adapter</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.adapter.ContextRequestAdapter">
-<em class="property">class </em><code class="descclassname">pyams_utils.adapter.</code><code class="descname">ContextRequestAdapter</code><span class="sig-paren">(</span><em>context</em>, <em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.adapter.ContextRequestAdapter" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Context + request multi-adapter</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.adapter.ContextRequestViewAdapter">
-<em class="property">class </em><code class="descclassname">pyams_utils.adapter.</code><code class="descname">ContextRequestViewAdapter</code><span class="sig-paren">(</span><em>context</em>, <em>request</em>, <em>view</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.adapter.ContextRequestViewAdapter" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Context + request + view multi-adapter</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.adapter.adapter_config">
-<em class="property">class </em><code class="descclassname">pyams_utils.adapter.</code><code class="descname">adapter_config</code><span class="sig-paren">(</span><em>**settings</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.adapter.adapter_config" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Function or class decorator to declare an adapter</p>
-<p>Annotation parameters can be:</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>name</strong> (<em>str</em>) &#8211; (default=&#8217;&#8216;), name of the adapter</li>
-<li><strong>context</strong> (<em>[Interface...]</em>) &#8211; an interface, or a tuple of interfaces, that the component adapts</li>
-<li><strong>provides</strong> (<em>Interface</em>) &#8211; the interface that the adapter provides</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<dl class="attribute">
-<dt id="pyams_utils.adapter.adapter_config.venusian">
-<code class="descname">venusian</code><em class="property"> = &lt;module 'venusian' from '/var/local/env/pyams/eggs/venusian-1.0-py3.4.egg/venusian/__init__.py'&gt;</em><a class="headerlink" href="#pyams_utils.adapter.adapter_config.venusian" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.attr">
-<span id="pyams-utils-attr-module"></span><h2>pyams_utils.attr module<a class="headerlink" href="#module-pyams_utils.attr" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.attr.AttributeTraverser">
-<em class="property">class </em><code class="descclassname">pyams_utils.attr.</code><code class="descname">AttributeTraverser</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.attr.AttributeTraverser" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextAdapter" title="pyams_utils.adapter.ContextAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextAdapter</span></code></a></p>
-<p>++attr++ namespace traverser</p>
-<p>This custom traversing adapter can be used to access an object attribute directly from
-an URL by using a path like this:</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="nb">object</span><span class="o">/++</span><span class="n">attr</span><span class="o">++</span><span class="n">name</span>
-</pre></div>
-</div>
-<p>Whare <em>name</em> is the name of the requested attribute</p>
-<dl class="method">
-<dt id="pyams_utils.attr.AttributeTraverser.traverse">
-<code class="descname">traverse</code><span class="sig-paren">(</span><em>name</em>, <em>furtherpath=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.attr.AttributeTraverser.traverse" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.container">
-<span id="pyams-utils-container-module"></span><h2>pyams_utils.container module<a class="headerlink" href="#module-pyams_utils.container" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.container.BTreeOrderedContainer">
-<em class="property">class </em><code class="descclassname">pyams_utils.container.</code><code class="descname">BTreeOrderedContainer</code><a class="headerlink" href="#pyams_utils.container.BTreeOrderedContainer" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.container.ordered.OrderedContainer</span></code></p>
-<p>BTree based ordered container</p>
-<p>This container maintain a manual order of it&#8217;s contents</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.container.ContainerSublocationsAdapter">
-<em class="property">class </em><code class="descclassname">pyams_utils.container.</code><code class="descname">ContainerSublocationsAdapter</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.container.ContainerSublocationsAdapter" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextAdapter" title="pyams_utils.adapter.ContextAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextAdapter</span></code></a></p>
-<p>Contained object sub-locations adapter</p>
-<p>This adapter checks for custom ISublocations interface adapters which can
-be defined by any component to get access to inner locations, defined for
-example via annotations.</p>
-<dl class="method">
-<dt id="pyams_utils.container.ContainerSublocationsAdapter.sublocations">
-<code class="descname">sublocations</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.container.ContainerSublocationsAdapter.sublocations" title="Permalink to this definition">¶</a></dt>
-<dd><p>See <cite>zope.location.interfaces.ISublocations</cite> interface</p>
-</dd></dl>
-
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.container.find_objects_matching">
-<code class="descclassname">pyams_utils.container.</code><code class="descname">find_objects_matching</code><span class="sig-paren">(</span><em>root</em>, <em>condition</em>, <em>ignore_root=False</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.container.find_objects_matching" title="Permalink to this definition">¶</a></dt>
-<dd><p>Find all objects in root that match the condition</p>
-<p>The condition is a Python callable object that takes an object as
-argument and must return a boolean result.</p>
-<p>All sub-objects of the root will also be searched recursively.</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 simple">
-<li><strong>root</strong> (<em>object</em>) &#8211; the parent object from which search is started</li>
-<li><strong>condition</strong> (<em>callable</em>) &#8211; a callable object which may return true for a given
-object to be selected</li>
-<li><strong>ignore_root</strong> (<em>boolean</em>) &#8211; if <em>True</em>, the root object will not be returned, even if it matches
-the given condition</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">an iterator for all root&#8217;s sub-objects matching condition</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.container.find_objects_providing">
-<code class="descclassname">pyams_utils.container.</code><code class="descname">find_objects_providing</code><span class="sig-paren">(</span><em>root</em>, <em>interface</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.container.find_objects_providing" title="Permalink to this definition">¶</a></dt>
-<dd><p>Find all objects in root that provide the specified interface</p>
-<p>All sub-objects of the root will also be searched recursively.</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 simple">
-<li><strong>root</strong> (<em>object</em>) &#8211; object; the parent object from which search is started</li>
-<li><strong>interface</strong> (<em>Interface</em>) &#8211; interface; an interface that sub-objects should provide</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">an iterator for all root&#8217;s sub-objects that provide the given interface</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.context">
-<span id="pyams-utils-context-module"></span><h2>pyams_utils.context module<a class="headerlink" href="#module-pyams_utils.context" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.context.ContextSelector">
-<em class="property">class </em><code class="descclassname">pyams_utils.context.</code><code class="descname">ContextSelector</code><span class="sig-paren">(</span><em>ifaces</em>, <em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.context.ContextSelector" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Interface based context selector</p>
-<p>This selector can be used as a subscriber predicate to define
-an interface that the context must support for the event to be applied:</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pyams_utils.interfaces.site</span> <span class="k">import</span> <span class="n">ISiteRoot</span>
-
-<span class="nd">@subscriber</span><span class="p">(</span><span class="n">IObjectModifiedEvent</span><span class="p">,</span> <span class="n">context_selector</span><span class="o">=</span><span class="n">ISiteRoot</span><span class="p">)</span>
-<span class="k">def</span> <span class="nf">siteroot_modified_event_handler</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
-    <span class="sd">&#39;&#39;&#39;This is an event handler for an ISiteRoot object modification event&#39;&#39;&#39;</span>
-</pre></div>
-</div>
-<dl class="method">
-<dt id="pyams_utils.context.ContextSelector.phash">
-<code class="descname">phash</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.context.ContextSelector.phash" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.context.ContextSelector.text">
-<code class="descname">text</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.context.ContextSelector.text" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.data">
-<span id="pyams-utils-data-module"></span><h2>pyams_utils.data module<a class="headerlink" href="#module-pyams_utils.data" title="Permalink to this headline">¶</a></h2>
-<p>Object data API module</p>
-<p>The <em>IObjectData</em> interface is a generic interface which can be used to assign custom data to nay object.
-This object data may be any object which can be serialized to JSON, and assigned to any HTML <em>data</em> attribute.
-It can typically be used to set a <em>data-ams-data</em> attribute to objects, which is afterwards converted to
-classic <em>data-</em> attributes by <strong>MyAMS.js</strong> framework.</p>
-<p>For example, for a custom widget in a form:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">updateWidgets</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
-    <span class="nb">super</span><span class="p">(</span><span class="n">MyForm</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">updateWidgets</span><span class="p">()</span>
-    <span class="n">widget</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">widgets</span><span class="p">[</span><span class="s">&#39;mywidget&#39;</span><span class="p">]</span>
-    <span class="n">alsoProvides</span><span class="p">(</span><span class="n">widget</span><span class="p">,</span> <span class="n">IObjectData</span><span class="p">)</span>
-    <span class="n">widget</span><span class="o">.</span><span class="n">object_data</span> <span class="o">=</span> <span class="p">{</span><span class="s">&#39;ams-colorpicker-position&#39;</span><span class="p">:</span> <span class="s">&#39;top left&#39;</span><span class="p">}</span>
-</pre></div>
-</div>
-<p>You can then set an attribute in a TAL template like this:</p>
-<div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;div</span> <span class="na">tal:attributes=</span><span class="s">&quot;data-ams-data extension:object_data(widget)&quot;</span><span class="nt">&gt;</span>...<span class="nt">&lt;/div&gt;</span>
-</pre></div>
-</div>
-<p>After data initialization by <strong>MyAMS.js</strong>, the following code will be converted to:</p>
-<div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;div</span> <span class="na">data-ams-colorpicker-position=</span><span class="s">&quot;top left&quot;</span><span class="nt">&gt;</span>...<span class="nt">&lt;/div&gt;</span>
-</pre></div>
-</div>
-<dl class="class">
-<dt id="pyams_utils.data.BrowserRequestDataExtension">
-<em class="property">class </em><code class="descclassname">pyams_utils.data.</code><code class="descname">BrowserRequestDataExtension</code><span class="sig-paren">(</span><em>context</em>, <em>request</em>, <em>view</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.data.BrowserRequestDataExtension" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextRequestViewAdapter" title="pyams_utils.adapter.ContextRequestViewAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextRequestViewAdapter</span></code></a></p>
-<p>extension:request_data TALES extension for Zope browser request</p>
-<p>This TALES extension can be used to get a request data, previously stored in the request via an annotation.
-For example:</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="o">&lt;</span><span class="n">div</span> <span class="n">tal</span><span class="p">:</span><span class="n">content</span><span class="o">=</span><span class="s">&quot;extension:request_data(&#39;my.annotation.key&#39;)&quot;</span><span class="o">&gt;...&lt;/</span><span class="n">div</span><span class="o">&gt;</span>
-</pre></div>
-</div>
-<dl class="method">
-<dt id="pyams_utils.data.BrowserRequestDataExtension.render">
-<code class="descname">render</code><span class="sig-paren">(</span><em>params=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.data.BrowserRequestDataExtension.render" title="Permalink to this definition">¶</a></dt>
-<dd><p>See <cite>pyams_utils.interfaces.tales.ITALESExtension</cite> interface</p>
-</dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.data.ObjectDataExtension">
-<em class="property">class </em><code class="descclassname">pyams_utils.data.</code><code class="descname">ObjectDataExtension</code><span class="sig-paren">(</span><em>context</em>, <em>request</em>, <em>view</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.data.ObjectDataExtension" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextRequestViewAdapter" title="pyams_utils.adapter.ContextRequestViewAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextRequestViewAdapter</span></code></a></p>
-<p>extension:object_data TALES extension</p>
-<p>This TALES extension is to be used in Chameleon templates to define a custom data attribute
-which stores all object data (see <cite>pyams_utils.interfaces.data.IObjectData</cite> interface), like this:</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="o">&lt;</span><span class="n">div</span> <span class="n">tal</span><span class="p">:</span><span class="n">attributes</span><span class="o">=</span><span class="s">&quot;data-ams-data extension:object_data(context)&quot;</span><span class="o">&gt;...&lt;/</span><span class="n">div</span><span class="o">&gt;</span>
-</pre></div>
-</div>
-<dl class="method">
-<dt id="pyams_utils.data.ObjectDataExtension.render">
-<code class="descname">render</code><span class="sig-paren">(</span><em>context=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.data.ObjectDataExtension.render" title="Permalink to this definition">¶</a></dt>
-<dd><p>See <cite>pyams_utils.interfaces.tales.ITALESExtension</cite> interface</p>
-</dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.data.ObjectDataRenderer">
-<em class="property">class </em><code class="descclassname">pyams_utils.data.</code><code class="descname">ObjectDataRenderer</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.data.ObjectDataRenderer" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextAdapter" title="pyams_utils.adapter.ContextAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextAdapter</span></code></a></p>
-<p>Object data JSON renderer</p>
-<dl class="method">
-<dt id="pyams_utils.data.ObjectDataRenderer.get_object_data">
-<code class="descname">get_object_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.data.ObjectDataRenderer.get_object_data" title="Permalink to this definition">¶</a></dt>
-<dd><p>See <cite>pyams_utils.interfaces.data.IObjectDataRenderer</cite> interface</p>
-</dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.data.PyramidRequestDataExtension">
-<em class="property">class </em><code class="descclassname">pyams_utils.data.</code><code class="descname">PyramidRequestDataExtension</code><span class="sig-paren">(</span><em>context</em>, <em>request</em>, <em>view</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.data.PyramidRequestDataExtension" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextRequestViewAdapter" title="pyams_utils.adapter.ContextRequestViewAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextRequestViewAdapter</span></code></a></p>
-<p>extension:request_data TALES extension for Pyramid request</p>
-<p>This TALES extension can be used to get a request data, previously stored in the request via an annotation.
-For example:</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="o">&lt;</span><span class="n">div</span> <span class="n">tal</span><span class="p">:</span><span class="n">content</span><span class="o">=</span><span class="s">&quot;extension:request_data(&#39;my.annotation.key&#39;)&quot;</span><span class="o">&gt;...&lt;/</span><span class="n">div</span><span class="o">&gt;</span>
-</pre></div>
-</div>
-<dl class="method">
-<dt id="pyams_utils.data.PyramidRequestDataExtension.render">
-<code class="descname">render</code><span class="sig-paren">(</span><em>params=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.data.PyramidRequestDataExtension.render" title="Permalink to this definition">¶</a></dt>
-<dd><p>See <cite>pyams_utils.interfaces.tales.ITALESExtension</cite> interface</p>
-</dd></dl>
-
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.date">
-<span id="pyams-utils-date-module"></span><h2>pyams_utils.date module<a class="headerlink" href="#module-pyams_utils.date" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.date.date_to_datetime">
-<code class="descclassname">pyams_utils.date.</code><code class="descname">date_to_datetime</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.date.date_to_datetime" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get datetime value converted from a date or datetime object</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>value</strong> (<em>date/datetime</em>) &#8211; a date or datetime value to convert</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">datetime; input value converted to datetime</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">date</span><span class="p">,</span> <span class="n">datetime</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.date</span> <span class="k">import</span> <span class="n">date_to_datetime</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">value</span> <span class="o">=</span> <span class="n">date</span><span class="p">(</span><span class="mi">2016</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date_to_datetime</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
-<span class="go">datetime.datetime(2016, 11, 15, 0, 0)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">value</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2016</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="mi">12</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">value</span>
-<span class="go">datetime.datetime(2016, 11, 15, 10, 13, 12)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date_to_datetime</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="ow">is</span> <span class="n">value</span>
-<span class="go">True</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.date.format_date">
-<code class="descclassname">pyams_utils.date.</code><code class="descname">format_date</code><span class="sig-paren">(</span><em>value</em>, <em>format='on %d/%m/%Y'</em>, <em>request=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.date.format_date" title="Permalink to this definition">¶</a></dt>
-<dd><p>Format given date with the given format</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 simple">
-<li><strong>value</strong> (<em>datetime</em>) &#8211; the value to format</li>
-<li><strong>format</strong> (<em>str</em>) &#8211; a format string to use by <cite>strftime</cite> function</li>
-<li><strong>request</strong> &#8211; the request from which to extract localization info for translation</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">str; input datetime converted to given format</p>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.date</span> <span class="k">import</span> <span class="n">format_date</span><span class="p">,</span> <span class="n">SH_DATE_FORMAT</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">value</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2016</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="mi">12</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">format_date</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
-<span class="go">&#39;on 15/11/2016&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">format_date</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">SH_DATE_FORMAT</span><span class="p">)</span>
-<span class="go">&#39;15/11/2016&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.date.format_datetime">
-<code class="descclassname">pyams_utils.date.</code><code class="descname">format_datetime</code><span class="sig-paren">(</span><em>value</em>, <em>format='on %d/%m/%Y at %H:%M'</em>, <em>request=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.date.format_datetime" title="Permalink to this definition">¶</a></dt>
-<dd><p>Format given datetime with the given format including time</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 simple">
-<li><strong>value</strong> (<em>datetime</em>) &#8211; the value to format</li>
-<li><strong>format</strong> (<em>str</em>) &#8211; a format string to use by <cite>strftime</cite> function</li>
-<li><strong>request</strong> &#8211; request; the request from which to extract localization info for translation</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">str; input datetime converted to given format</p>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.date</span> <span class="k">import</span> <span class="n">format_datetime</span><span class="p">,</span> <span class="n">SH_DATETIME_FORMAT</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">value</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2016</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="mi">12</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">format_datetime</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
-<span class="go">&#39;on 15/11/2016 at 10:13&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">format_datetime</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">SH_DATETIME_FORMAT</span><span class="p">)</span>
-<span class="go">&#39;15/11/2016 - 10:13&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.date.get_age">
-<code class="descclassname">pyams_utils.date.</code><code class="descname">get_age</code><span class="sig-paren">(</span><em>value</em>, <em>request=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.date.get_age" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get &#8216;human&#8217; age of a given datetime (including timezone) compared to current datetime (in UTC)</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>value</strong> (<em>datetime</em>) &#8211; input datetime to be compared with current datetime</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">str; the delta value, converted to months, weeks, days, hours or minutes</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.date.get_duration">
-<code class="descclassname">pyams_utils.date.</code><code class="descname">get_duration</code><span class="sig-paren">(</span><em>v1</em>, <em>v2=None</em>, <em>request=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.date.get_duration" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get &#8216;human&#8217; delta as string between two dates</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 simple">
-<li><strong>v1</strong> (<em>datetime</em>) &#8211; start date</li>
-<li><strong>v2</strong> (<em>datetime</em>) &#8211; end date, or current date (in UTC) if None</li>
-<li><strong>request</strong> &#8211; the request from which to extract localization infos</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">str; approximate delta between the two input dates</p>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.date</span> <span class="k">import</span> <span class="n">get_duration</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyramid.testing</span> <span class="k">import</span> <span class="n">DummyRequest</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">request</span> <span class="o">=</span> <span class="n">DummyRequest</span><span class="p">()</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date1</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2015</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date2</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2014</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_duration</span><span class="p">(</span><span class="n">date1</span><span class="p">,</span> <span class="n">date2</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;10 months&#39;</span>
-</pre></div>
-</div>
-<p>Dates order is not important:</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">get_duration</span><span class="p">(</span><span class="n">date2</span><span class="p">,</span> <span class="n">date1</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;10 months&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date2</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2014</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_duration</span><span class="p">(</span><span class="n">date1</span><span class="p">,</span> <span class="n">date2</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;7 weeks&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date2</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2014</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">26</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_duration</span><span class="p">(</span><span class="n">date1</span><span class="p">,</span> <span class="n">date2</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;6 days&#39;</span>
-</pre></div>
-</div>
-<p>For durations lower than 2 days, duration also display hours:</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">date1</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2015</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date2</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2015</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_duration</span><span class="p">(</span><span class="n">date1</span><span class="p">,</span> <span class="n">date2</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;1 day and 15 hours&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date2</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2015</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_duration</span><span class="p">(</span><span class="n">date1</span><span class="p">,</span> <span class="n">date2</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;24 hours&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date2</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2015</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="mi">12</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_duration</span><span class="p">(</span><span class="n">date1</span><span class="p">,</span> <span class="n">date2</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;13 hours&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date2</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2015</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_duration</span><span class="p">(</span><span class="n">date1</span><span class="p">,</span> <span class="n">date2</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;75 minutes&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">date2</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2015</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_duration</span><span class="p">(</span><span class="n">date1</span><span class="p">,</span> <span class="n">date2</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;15 seconds&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.date.parse_date">
-<code class="descclassname">pyams_utils.date.</code><code class="descname">parse_date</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.date.parse_date" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get date specified in unicode ISO format to Python datetime object</p>
-<p>Dates are always assumed to be stored in GMT timezone</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>value</strong> (<em>str</em>) &#8211; unicode date to be parsed</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">datetime; the specified value, converted to datetime</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.date</span> <span class="k">import</span> <span class="n">parse_date</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">parse_date</span><span class="p">(</span><span class="s">&#39;2016-11-15T10:13:12+00:00&#39;</span><span class="p">)</span>
-<span class="go">datetime.datetime(2016, 11, 15, 10, 13, 12, tzinfo=&lt;StaticTzInfo &#39;GMT&#39;&gt;)</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.date.unidate">
-<code class="descclassname">pyams_utils.date.</code><code class="descname">unidate</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.date.unidate" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get specified date converted to unicode ISO format</p>
-<p>Dates are always assumed to be stored in GMT timezone</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>value</strong> (<a class="reference internal" href="#module-pyams_utils.date" title="pyams_utils.date"><em>date</em></a>) &#8211; input date to convert to unicode</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">unicode; input date converted to unicode</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.date</span> <span class="k">import</span> <span class="n">unidate</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">value</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2016</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="mi">12</span><span class="p">)</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">unidate</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
-<span class="go">&#39;2016-11-15T10:13:12+00:00&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.decorator">
-<span id="pyams-utils-decorator-module"></span><h2>pyams_utils.decorator module<a class="headerlink" href="#module-pyams_utils.decorator" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.decorator.deprecated">
-<code class="descclassname">pyams_utils.decorator.</code><code class="descname">deprecated</code><span class="sig-paren">(</span><em>*msg</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.decorator.deprecated" title="Permalink to this definition">¶</a></dt>
-<dd><p>This is a decorator which can be used to mark functions
-as deprecated. It will result in a warning being emitted
-when the function is used.</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.encoding">
-<span id="pyams-utils-encoding-module"></span><h2>pyams_utils.encoding module<a class="headerlink" href="#module-pyams_utils.encoding" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.encoding.EncodingField">
-<em class="property">class </em><code class="descclassname">pyams_utils.encoding.</code><code class="descname">EncodingField</code><span class="sig-paren">(</span><em>vocabulary='PyAMS encodings'</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.encoding.EncodingField" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema._field.Choice</span></code></p>
-<p>Encoding schema field</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.encoding.EncodingsVocabulary">
-<em class="property">class </em><code class="descclassname">pyams_utils.encoding.</code><code class="descname">EncodingsVocabulary</code><span class="sig-paren">(</span><em>terms</em>, <em>*interfaces</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.encoding.EncodingsVocabulary" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema.vocabulary.SimpleVocabulary</span></code></p>
-<p>A vocabulary containing a set of registered encodings</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.html">
-<span id="pyams-utils-html-module"></span><h2>pyams_utils.html module<a class="headerlink" href="#module-pyams_utils.html" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.html.MyHTMLParser">
-<em class="property">class </em><code class="descclassname">pyams_utils.html.</code><code class="descname">MyHTMLParser</code><span class="sig-paren">(</span><em>strict=&lt;object object&gt;</em>, <em>*</em>, <em>convert_charrefs=&lt;object object&gt;</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.html.MyHTMLParser" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">html.parser.HTMLParser</span></code></p>
-<p>HTML parser</p>
-<dl class="attribute">
-<dt id="pyams_utils.html.MyHTMLParser.charrefs">
-<code class="descname">charrefs</code><em class="property"> = {34: '&quot;', 38: '&amp;', 39: &quot;'&quot;, 60: '&lt;', 62: '&gt;', 192: 'À', 193: 'A', 194: 'Â', 195: 'A', 196: 'Ä', 197: 'A', 198: 'AE', 199: 'Ç', 200: 'È', 201: 'É', 202: 'Ê', 203: 'Ë', 204: 'I', 205: 'I', 206: 'Î', 207: 'Ï', 208: 'D', 209: 'N', 210: 'O', 211: 'O', 212: 'Ô', 213: 'O', 214: 'Ö', 215: 'x', 216: 'O', 217: 'Ù', 218: 'U', 219: 'Û', 220: 'Ü', 221: 'Y', 222: 'T', 223: 'sz', 224: 'à', 225: 'a', 226: 'â', 227: 'a', 228: 'ä', 229: 'a', 230: 'ae', 231: 'ç', 232: 'è', 233: 'é', 234: 'ê', 235: 'ë', 236: 'i', 237: 'i', 238: 'î', 239: 'ï', 240: 'e', 241: 'n', 242: 'o', 243: 'o', 244: 'ô', 245: 'o', 246: 'ö', 248: 'o', 249: 'ù', 250: 'u', 251: 'û', 252: 'ü', 253: 'y', 255: 'ÿ'}</em><a class="headerlink" href="#pyams_utils.html.MyHTMLParser.charrefs" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.html.MyHTMLParser.data">
-<code class="descname">data</code><em class="property"> = ''</em><a class="headerlink" href="#pyams_utils.html.MyHTMLParser.data" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.html.MyHTMLParser.entitydefs">
-<code class="descname">entitydefs</code><em class="property"> = {'ecirc': 'ê', 'aring': 'a', 'Aring': 'A', 'thorn': 't', 'agrave': 'à', 'Ograve': 'O', 'ocirc': 'ô', 'Eacute': 'È', 'eacute': 'é', 'atilde': 'a', 'iuml': 'ï', 'aelig': 'ae', 'igrave': 'i', 'Auml': 'Ä', 'Uuml': 'Ü', 'ucirc': 'û', 'ugrave': 'ù', 'iacute': 'i', 'ograve': 'o', 'oacute': 'o', 'Euml': 'Ë', 'apos': &quot;'&quot;, 'Ouml': 'Ö', 'aacute': 'a', 'Ccedil': 'Ç', 'Oslash': 'O', 'egrave': 'è', 'Uacute': 'U', 'uacute': 'u', 'Igrave': 'I', 'Agrave': 'À', 'Iuml': 'I', 'Otilde': 'O', 'Yacute': 'Y', 'ntilde': 'n', 'Ugrave': 'Ù', 'Ucirc': 'Û', 'icirc': 'î', 'Ecirc': 'Ê', 'Ntilde': 'N', 'Egrave': 'É', 'nbsp': ' ', 'quot': '&quot;', 'oslash': 'o', 'ouml': 'ö', 'yacute': 'y', 'uuml': 'ü', 'yuml': 'ÿ', 'Aacute': 'A', 'Icirc': 'I', 'euml': 'ë', 'otilde': 'o', 'auml': 'ä', 'ccedil': 'ç', 'Oacute': 'O', 'lt': '&lt;', 'amp': '&amp;', 'Iacute': 'I', 'Ocirc': 'Ô', 'gt': '&gt;', 'Atilde': 'A', 'acirc': 'â', 'Acirc': 'Â', 'THORN': 'T', 'AElig': 'AE'}</em><a class="headerlink" href="#pyams_utils.html.MyHTMLParser.entitydefs" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.html.MyHTMLParser.handle_charref">
-<code class="descname">handle_charref</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.html.MyHTMLParser.handle_charref" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.html.MyHTMLParser.handle_data">
-<code class="descname">handle_data</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.html.MyHTMLParser.handle_data" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.html.MyHTMLParser.handle_endtag">
-<code class="descname">handle_endtag</code><span class="sig-paren">(</span><em>tag</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.html.MyHTMLParser.handle_endtag" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.html.MyHTMLParser.handle_entityref">
-<code class="descname">handle_entityref</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.html.MyHTMLParser.handle_entityref" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.html.MyHTMLParser.handle_starttag">
-<code class="descname">handle_starttag</code><span class="sig-paren">(</span><em>tag</em>, <em>attrs</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.html.MyHTMLParser.handle_starttag" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.html.html_to_text">
-<code class="descclassname">pyams_utils.html.</code><code class="descname">html_to_text</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.html.html_to_text" title="Permalink to this definition">¶</a></dt>
-<dd><p>Utility function to extract text content from HTML</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.html</span> <span class="k">import</span> <span class="n">html_to_text</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">html</span> <span class="o">=</span> <span class="s">&#39;&#39;&#39;&lt;p&gt;This is a HTML text part.&lt;/p&gt;&#39;&#39;&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">html_to_text</span><span class="p">(</span><span class="n">html</span><span class="p">)</span>
-<span class="go">&#39;This is a HTML text part.\n&#39;</span>
-</pre></div>
-</div>
-<p>HTML parser should handle entities correctly:</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">html</span> <span class="o">=</span> <span class="s">&#39;&#39;&#39;&lt;div&gt;&lt;p&gt;Header&lt;/p&gt;&lt;p&gt;This is an &amp;lt;&amp;nbsp;&amp;#242;&amp;nbsp;&amp;gt; entity.&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&#39;&#39;&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">html_to_text</span><span class="p">(</span><span class="n">html</span><span class="p">)</span>
-<span class="go">&#39;Header\nThis is an &lt; o &gt; entity.\n\n&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.i18n">
-<span id="pyams-utils-i18n-module"></span><h2>pyams_utils.i18n module<a class="headerlink" href="#module-pyams_utils.i18n" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.i18n.get_browser_language">
-<code class="descclassname">pyams_utils.i18n.</code><code class="descname">get_browser_language</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.i18n.get_browser_language" title="Permalink to this definition">¶</a></dt>
-<dd><p>Custom locale negotiator</p>
-<p>Copied from zope.publisher code</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.i18n.normalize_lang">
-<code class="descclassname">pyams_utils.i18n.</code><code class="descname">normalize_lang</code><span class="sig-paren">(</span><em>lang</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.i18n.normalize_lang" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.include">
-<span id="pyams-utils-include-module"></span><h2>pyams_utils.include module<a class="headerlink" href="#module-pyams_utils.include" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.include.include_package">
-<code class="descclassname">pyams_utils.include.</code><code class="descname">include_package</code><span class="sig-paren">(</span><em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.include.include_package" title="Permalink to this definition">¶</a></dt>
-<dd><p>Pyramid package include</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.intids">
-<span id="pyams-utils-intids-module"></span><h2>pyams_utils.intids module<a class="headerlink" href="#module-pyams_utils.intids" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.intids.UniqueIdAdapter">
-<em class="property">class </em><code class="descclassname">pyams_utils.intids.</code><code class="descname">UniqueIdAdapter</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.intids.UniqueIdAdapter" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextAdapter" title="pyams_utils.adapter.ContextAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextAdapter</span></code></a></p>
-<p>Object unique ID adapter</p>
-<p>This adapter is based on a registered IIntIds utility to get a unique ID
-for any persistent object.</p>
-<dl class="attribute">
-<dt id="pyams_utils.intids.UniqueIdAdapter.oid">
-<code class="descname">oid</code><a class="headerlink" href="#pyams_utils.intids.UniqueIdAdapter.oid" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get context ID in hexadecimal form</p>
-</dd></dl>
-
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.intids.handle_added_object">
-<code class="descclassname">pyams_utils.intids.</code><code class="descname">handle_added_object</code><span class="sig-paren">(</span><em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.intids.handle_added_object" title="Permalink to this definition">¶</a></dt>
-<dd><p>Notify IntId utility for added objects</p>
-<p>This subscriber is used for all persistent objects to be registered
-in all locally registered IIntIds utilities.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.intids.handle_intid_event">
-<code class="descclassname">pyams_utils.intids.</code><code class="descname">handle_intid_event</code><span class="sig-paren">(</span><em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.intids.handle_intid_event" title="Permalink to this definition">¶</a></dt>
-<dd><p>Event subscriber used to dispatch all IIntIdEvent events using Pyramid events subscribers to matching
-subscribers using Zope events</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.intids.handle_removed_object">
-<code class="descclassname">pyams_utils.intids.</code><code class="descname">handle_removed_object</code><span class="sig-paren">(</span><em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.intids.handle_removed_object" title="Permalink to this definition">¶</a></dt>
-<dd><p>Notify IntId utility for removed objects</p>
-<p>This subscriber is used for all persistent objects to be unregistered
-from all locally registered IIntIds utilities.</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.list">
-<span id="pyams-utils-list-module"></span><h2>pyams_utils.list module<a class="headerlink" href="#module-pyams_utils.list" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.list.unique">
-<code class="descclassname">pyams_utils.list.</code><code class="descname">unique</code><span class="sig-paren">(</span><em>seq</em>, <em>idfun=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.list.unique" title="Permalink to this definition">¶</a></dt>
-<dd><p>Extract unique values from list, preserving order</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 simple">
-<li><strong>seq</strong> (<a class="reference internal" href="#module-pyams_utils.list" title="pyams_utils.list"><em>list</em></a>) &#8211; input list</li>
-<li><strong>idfun</strong> (<em>callable</em>) &#8211; an identity function which is used to get &#8216;identity&#8217; value of each element
-in the list</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">list; a new list containing only unique elements of the original list in their initial order.
-Original list is not modified.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.list</span> <span class="k">import</span> <span class="n">unique</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">mylist</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">]</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">unique</span><span class="p">(</span><span class="n">mylist</span><span class="p">)</span>
-<span class="go">[1, 2, 3]</span>
-</pre></div>
-</div>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">mylist</span> <span class="o">=</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">unique</span><span class="p">(</span><span class="n">mylist</span><span class="p">)</span>
-<span class="go">[3, 2, 1, 4]</span>
-</pre></div>
-</div>
-<p>You can also set an &#8216;id&#8217; function applied on each element:</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">mylist</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="s">&#39;2&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">]</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">unique</span><span class="p">(</span><span class="n">mylist</span><span class="p">,</span> <span class="n">idfun</span><span class="o">=</span><span class="nb">str</span><span class="p">)</span>
-<span class="go">[1, 2, 3, 4]</span>
-</pre></div>
-</div>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.lock">
-<span id="pyams-utils-lock-module"></span><h2>pyams_utils.lock module<a class="headerlink" href="#module-pyams_utils.lock" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.lock.CacheLock">
-<em class="property">class </em><code class="descclassname">pyams_utils.lock.</code><code class="descname">CacheLock</code><span class="sig-paren">(</span><em>name</em>, <em>wait=True</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.lock.CacheLock" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Beaker based lock</p>
-<p>This lock can be used when you need to get a lot across several processes or even computers.
-The lock relies on a shared value stored into a shared Beaker cache.</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>name</strong> (<em>str</em>) &#8211; name of the lock to use as shared key</li>
-<li><strong>wait</strong> (<em>boolean</em>) &#8211; if <em>False</em>, a <em>LockException</em> is raised if lock can&#8217;t be taken; otherwise,
-application waits until lock is released</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<p>Lock can be used as a context manager.</p>
-</dd></dl>
-
-<dl class="exception">
-<dt id="pyams_utils.lock.LockException">
-<em class="property">exception </em><code class="descclassname">pyams_utils.lock.</code><code class="descname">LockException</code><a class="headerlink" href="#pyams_utils.lock.LockException" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">Exception</span></code></p>
-<p>Cache lock exception</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.lock.get_locks_cache">
-<code class="descclassname">pyams_utils.lock.</code><code class="descname">get_locks_cache</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.lock.get_locks_cache" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get locks shared cache</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.lock.locked">
-<code class="descclassname">pyams_utils.lock.</code><code class="descname">locked</code><span class="sig-paren">(</span><em>name</em>, <em>wait=True</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.lock.locked" title="Permalink to this definition">¶</a></dt>
-<dd><p>Locked function decorator</p>
-<p>Can be used with any function or method which requires a global shared lock.</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>name</strong> (<em>str</em>) &#8211; name of the lock to use as shared key</li>
-<li><strong>wait</strong> (<em>boolean</em>) &#8211; if <em>False</em>, a <em>LockException</em> is raised if lock can&#8217;t be taken; otherwise,
-application waits until lock is released</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.progress">
-<span id="pyams-utils-progress-module"></span><h2>pyams_utils.progress module<a class="headerlink" href="#module-pyams_utils.progress" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.progress.get_progress_cache">
-<code class="descclassname">pyams_utils.progress.</code><code class="descname">get_progress_cache</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.progress.get_progress_cache" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get cache storing tasks progress</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.progress.get_progress_status_view">
-<code class="descclassname">pyams_utils.progress.</code><code class="descname">get_progress_status_view</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.progress.get_progress_status_view" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get progress status of a given task</p>
-<p>Each submitted task is identified by an ID defined when the task is created</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.progress.get_running_tasks">
-<code class="descclassname">pyams_utils.progress.</code><code class="descname">get_running_tasks</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.progress.get_running_tasks" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get list of running tasks</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.progress.get_tasks_cache">
-<code class="descclassname">pyams_utils.progress.</code><code class="descname">get_tasks_cache</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.progress.get_tasks_cache" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get cache storing tasks list</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.progress.set_running_tasks">
-<code class="descclassname">pyams_utils.progress.</code><code class="descname">set_running_tasks</code><span class="sig-paren">(</span><em>tasks</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.progress.set_running_tasks" title="Permalink to this definition">¶</a></dt>
-<dd><p>Update list of running tasks</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.property">
-<span id="pyams-utils-property-module"></span><h2>pyams_utils.property module<a class="headerlink" href="#module-pyams_utils.property" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.property.DocFieldProperty">
-<em class="property">class </em><code class="descclassname">pyams_utils.property.</code><code class="descname">DocFieldProperty</code><span class="sig-paren">(</span><em>field</em>, <em>name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.property.DocFieldProperty" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema.fieldproperty.FieldProperty</span></code></p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.property.cached">
-<em class="property">class </em><code class="descclassname">pyams_utils.property.</code><code class="descname">cached</code><span class="sig-paren">(</span><em>function</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.property.cached" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Custom property decorator to define a property or function which is calculated only once</p>
-<p>When applied on a function, caching is based on input arguments</p>
-<dl class="method">
-<dt id="pyams_utils.property.cached.expire">
-<code class="descname">expire</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.property.cached.expire" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.property.cached_property">
-<em class="property">class </em><code class="descclassname">pyams_utils.property.</code><code class="descname">cached_property</code><span class="sig-paren">(</span><em>fget</em>, <em>doc=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.property.cached_property" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>A read-only property decorator that is only evaluated once.</p>
-<p>The value is cached on the object itself rather than the function or class; this should prevent
-memory leakage.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.property.request_property">
-<code class="descclassname">pyams_utils.property.</code><code class="descname">request_property</code><span class="sig-paren">(</span><em>key</em>, <em>prefix=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.property.request_property" title="Permalink to this definition">¶</a></dt>
-<dd><p>Define a method decorator used to store result into current request&#8217;s annotations</p>
-<p>If not request is currently running, a new one is created.
-<cite>key</cite> is a required argument; if None, the key will be the method&#8217;s object</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>) &#8211; session&#8217;s value key; if <em>None</em>, the key will be the method&#8217;s object; if <em>key</em> is a callable
-object, it will be called to get the actual session key</li>
-<li><strong>prefix</strong> &#8211; str; prefix to use for session key; if <em>None</em>, the prefix will be the property name</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.property.session_property">
-<code class="descclassname">pyams_utils.property.</code><code class="descname">session_property</code><span class="sig-paren">(</span><em>app</em>, <em>key=None</em>, <em>prefix=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.property.session_property" title="Permalink to this definition">¶</a></dt>
-<dd><p>Define a method decorator used to store result into request&#8217;s session</p>
-<p>If no request is currently running, a new one is created.</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>app</strong> (<em>str</em>) &#8211; application identifier used to prefix session keys</li>
-<li><strong>key</strong> (<em>str</em>) &#8211; session&#8217;s value key; if <em>None</em>, the key will be the method&#8217;s object; if <em>key</em> is a callable
-object, il will be called to get the actual session key</li>
-<li><strong>prefix</strong> &#8211; str; prefix to use for session key; if <em>None</em>, the prefix will be the property name</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.registry">
-<span id="pyams-utils-registry-module"></span><h2>pyams_utils.registry module<a class="headerlink" href="#module-pyams_utils.registry" title="Permalink to this headline">¶</a></h2>
-<p>Local registry management package</p>
-<p>This package is used to manage <em>local registry</em>. A local registry is a <em>site management</em> component
-created automatically on application startup by PyAMS_utils package. It can be used to store and register
-components, mainly utilities which are created and configured dynamically by a site administrator; this can include
-SQLAlchemy engines, ZEO connections, and several PyAMS utilities like security manager, medias converter,
-tasks scheduler and many other ones.</p>
-<p>See <a class="reference internal" href="zca.html#zca"><span class="std std-ref">Managing ZCA with PyAMS</span></a> to get a brief introduction about using a local registry with PyAMS packages.</p>
-<dl class="class">
-<dt id="pyams_utils.registry.LocalRegistry">
-<em class="property">class </em><code class="descclassname">pyams_utils.registry.</code><code class="descname">LocalRegistry</code><a class="headerlink" href="#pyams_utils.registry.LocalRegistry" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">_thread._local</span></code></p>
-<p>Local registry</p>
-<dl class="method">
-<dt id="pyams_utils.registry.LocalRegistry.get_registry">
-<code class="descname">get_registry</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.LocalRegistry.get_registry" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.registry.LocalRegistry.set_registry">
-<code class="descname">set_registry</code><span class="sig-paren">(</span><em>registry</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.LocalRegistry.set_registry" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.get_all_utilities_registered_for">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">get_all_utilities_registered_for</code><span class="sig-paren">(</span><em>interface</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.get_all_utilities_registered_for" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get list of registered utilities for given interface</p>
-<p>Do a registry lookup for matching utilities into local registry first, then on each registry
-associated with current thread stack.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.get_local_registry">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">get_local_registry</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.get_local_registry" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get local registry</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.get_registries">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">get_registries</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.get_registries" title="Permalink to this definition">¶</a></dt>
-<dd><p>Iterator on components registries</p>
-<p>Returns an iterator on current local registry (if any) and registries associated
-in current thread stack.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.get_utilities_for">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">get_utilities_for</code><span class="sig-paren">(</span><em>interface</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.get_utilities_for" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get utilities registered with given interface as (name, util) tuples iterator</p>
-<p>Do a registry lookup for matching utilities into local registry first, then on each registry
-associated with current thread stack.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.get_utility">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">get_utility</code><span class="sig-paren">(</span><em>provided</em>, <em>name=''</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.get_utility" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get utility registered with given interface</p>
-<p>Do a registry lookup for given utility into local registry first, then on each registry
-associated with current thread stack.</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 simple">
-<li><strong>provided</strong> (<em>Interface</em>) &#8211; the requested interface</li>
-<li><strong>name</strong> (<em>str</em>) &#8211; name of the requested utility</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">object; the requested object. A <em>ComponentLookupError</em> is raised if the utility
-can&#8217;t be found.</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.handle_new_request">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">handle_new_request</code><span class="sig-paren">(</span><em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.handle_new_request" title="Permalink to this definition">¶</a></dt>
-<dd><p>New request event subscriber</p>
-<p>Is used to initialize local registry to None for any new request</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.handle_site_before_traverse">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">handle_site_before_traverse</code><span class="sig-paren">(</span><em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.handle_site_before_traverse" title="Permalink to this definition">¶</a></dt>
-<dd><p>Before traverse event subscriber</p>
-<p>Define site&#8217;s local registry when an object implementing ISite is traversed</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.query_utility">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">query_utility</code><span class="sig-paren">(</span><em>provided</em>, <em>name=''</em>, <em>default=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.query_utility" title="Permalink to this definition">¶</a></dt>
-<dd><p>Query utility registered with given interface</p>
-<p>Do a registry lookup for given utility into local registry first, then on each registry
-associated with current thread stack.</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 simple">
-<li><strong>provided</strong> (<em>Interface</em>) &#8211; the requested interface</li>
-<li><strong>name</strong> (<em>str</em>) &#8211; name of the requested utility</li>
-<li><strong>default</strong> (<em>object</em>) &#8211; the default object returned if the requested utility can&#8217;t be found</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">object; the requested object, or <em>default</em> if it can&#8217;t be found</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.registered_utilities">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">registered_utilities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.registered_utilities" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get utilities registrations as generator</p>
-<p>Iterates over utilities defined in all registries, starting with local ones.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.registry.set_local_registry">
-<code class="descclassname">pyams_utils.registry.</code><code class="descname">set_local_registry</code><span class="sig-paren">(</span><em>registry</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.set_local_registry" title="Permalink to this definition">¶</a></dt>
-<dd><p>Define local registry</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.registry.utility_config">
-<em class="property">class </em><code class="descclassname">pyams_utils.registry.</code><code class="descname">utility_config</code><span class="sig-paren">(</span><em>**settings</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.registry.utility_config" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Function or class decorator to register a utility in the global registry</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>name</strong> (<em>str</em>) &#8211; default=&#8217;&#8216;; name under which the utility is registered</li>
-<li><strong>provides</strong> (<em>Interface</em>) &#8211; the interface for which the utility is registered</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<p>Please note that a single utility can be registered several times (using several annotations).</p>
-<dl class="attribute">
-<dt id="pyams_utils.registry.utility_config.venusian">
-<code class="descname">venusian</code><em class="property"> = &lt;module 'venusian' from '/var/local/env/pyams/eggs/venusian-1.0-py3.4.egg/venusian/__init__.py'&gt;</em><a class="headerlink" href="#pyams_utils.registry.utility_config.venusian" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.request">
-<span id="pyams-utils-request-module"></span><h2>pyams_utils.request module<a class="headerlink" href="#module-pyams_utils.request" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.request.check_request">
-<code class="descclassname">pyams_utils.request.</code><code class="descname">check_request</code><span class="sig-paren">(</span><em>path='/'</em>, <em>environ=None</em>, <em>base_url=None</em>, <em>headers=None</em>, <em>POST=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.request.check_request" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get current request, or create a new blank one if missing</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.request.get_annotations">
-<code class="descclassname">pyams_utils.request.</code><code class="descname">get_annotations</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.request.get_annotations" title="Permalink to this definition">¶</a></dt>
-<dd><p>Define &#8216;annotations&#8217; request property</p>
-<p>This function is automatically defined as a custom request method on package include.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.request.get_debug">
-<code class="descclassname">pyams_utils.request.</code><code class="descname">get_debug</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.request.get_debug" title="Permalink to this definition">¶</a></dt>
-<dd><p>Define &#8216;debug&#8217; request property</p>
-<p>This function is automatically defined as a custom request method on package include.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.request.get_request">
-<code class="descclassname">pyams_utils.request.</code><code class="descname">get_request</code><span class="sig-paren">(</span><em>raise_exception=True</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.request.get_request" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get current request</p>
-<p>Raises a NoInteraction exception if there is no active request.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.request.get_request_data">
-<code class="descclassname">pyams_utils.request.</code><code class="descname">get_request_data</code><span class="sig-paren">(</span><em>request</em>, <em>key</em>, <em>default=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.request.get_request_data" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get data associated with request</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 simple">
-<li><strong>request</strong> &#8211; the request containing requested data</li>
-<li><strong>key</strong> (<em>str</em>) &#8211; request data annotation key</li>
-<li><strong>default</strong> (<em>object</em>) &#8211; the default value when data is missing</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the requested value, or <em>default</em></p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.request.query_request">
-<code class="descclassname">pyams_utils.request.</code><code class="descname">query_request</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.request.query_request" title="Permalink to this definition">¶</a></dt>
-<dd><p>Query current request</p>
-<p>Returns None if there is no active request</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.request.set_request_data">
-<code class="descclassname">pyams_utils.request.</code><code class="descname">set_request_data</code><span class="sig-paren">(</span><em>request</em>, <em>key</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.request.set_request_data" title="Permalink to this definition">¶</a></dt>
-<dd><p>Associate data with request</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>request</strong> &#8211; the request in which to set data</li>
-<li><strong>key</strong> (<em>str</em>) &#8211; request data annotation key</li>
-<li><strong>value</strong> (<em>object</em>) &#8211; the value to be set in request annotation</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.schema">
-<span id="pyams-utils-schema-module"></span><h2>pyams_utils.schema module<a class="headerlink" href="#module-pyams_utils.schema" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.schema.ColorField">
-<em class="property">class </em><code class="descclassname">pyams_utils.schema.</code><code class="descname">ColorField</code><span class="sig-paren">(</span><em>*args</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.ColorField" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema._bootstrapfields.TextLine</span></code></p>
-<p>Color field</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.schema.DatesRangeField">
-<em class="property">class </em><code class="descclassname">pyams_utils.schema.</code><code class="descname">DatesRangeField</code><span class="sig-paren">(</span><em>value_type=None</em>, <em>unique=False</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.DatesRangeField" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema._field.Tuple</span></code></p>
-<p>Dates range field</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.schema.DottedDecimalField">
-<em class="property">class </em><code class="descclassname">pyams_utils.schema.</code><code class="descname">DottedDecimalField</code><span class="sig-paren">(</span><em>*args</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.DottedDecimalField" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema._field.Decimal</span></code></p>
-<p>Dotted decimal field</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.schema.EncodedPassword">
-<em class="property">class </em><code class="descclassname">pyams_utils.schema.</code><code class="descname">EncodedPassword</code><span class="sig-paren">(</span><em>*args</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.EncodedPassword" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema._bootstrapfields.Password</span></code></p>
-<p>Encoded password field</p>
-<dl class="method">
-<dt id="pyams_utils.schema.EncodedPassword.constraint">
-<code class="descname">constraint</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.EncodedPassword.constraint" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.schema.EncodedPassword.fromUnicode">
-<code class="descname">fromUnicode</code><span class="sig-paren">(</span><em>str</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.EncodedPassword.fromUnicode" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.schema.HTMLField">
-<em class="property">class </em><code class="descclassname">pyams_utils.schema.</code><code class="descname">HTMLField</code><span class="sig-paren">(</span><em>*args</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.HTMLField" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema._bootstrapfields.Text</span></code></p>
-<p>HTML field</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.schema.PersistentDict">
-<em class="property">class </em><code class="descclassname">pyams_utils.schema.</code><code class="descname">PersistentDict</code><span class="sig-paren">(</span><em>key_type=None</em>, <em>value_type=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.PersistentDict" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema._field.Dict</span></code></p>
-<p>Persistent mapping field</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.schema.PersistentList">
-<em class="property">class </em><code class="descclassname">pyams_utils.schema.</code><code class="descname">PersistentList</code><span class="sig-paren">(</span><em>value_type=None</em>, <em>unique=False</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.PersistentList" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema._field.List</span></code></p>
-<p>Persistent list field</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.schema.TextLineListField">
-<em class="property">class </em><code class="descclassname">pyams_utils.schema.</code><code class="descname">TextLineListField</code><span class="sig-paren">(</span><em>value_type=None</em>, <em>unique=False</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.schema.TextLineListField" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema._field.List</span></code></p>
-<p>TextLine list field</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.session">
-<span id="pyams-utils-session-module"></span><h2>pyams_utils.session module<a class="headerlink" href="#module-pyams_utils.session" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.session.get_session_data">
-<code class="descclassname">pyams_utils.session.</code><code class="descname">get_session_data</code><span class="sig-paren">(</span><em>request</em>, <em>app</em>, <em>key</em>, <em>default=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.session.get_session_data" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get data associated with current user session</p>
-<p>PyAMS session management is based on <code class="xref py py-mod docutils literal"><span class="pre">Beaker</span></code> package session management.</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>request</strong> &#8211; the request from which session is extracted</li>
-<li><strong>app</strong> (<em>str</em>) &#8211; application name</li>
-<li><strong>key</strong> (<em>str</em>) &#8211; session data key for given application</li>
-<li><strong>default</strong> &#8211; object; requested session data, or <em>default</em> if it can&#8217;t be found</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-python"><div class="highlight"><pre><span class="n">APPLICATION_KEY</span> <span class="o">=</span> <span class="s">&#39;MyApp&#39;</span>
-<span class="n">SESSION_KEY</span> <span class="o">=</span> <span class="s">&#39;MyFunction&#39;</span>
-
-<span class="k">def</span> <span class="nf">my_function</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
-    <span class="k">return</span> <span class="n">get_session_data</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">APPLICATION_KEY</span><span class="p">,</span> <span class="n">SESSION_KEY</span><span class="p">)</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.session.set_session_data">
-<code class="descclassname">pyams_utils.session.</code><code class="descname">set_session_data</code><span class="sig-paren">(</span><em>request</em>, <em>app</em>, <em>key</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.session.set_session_data" title="Permalink to this definition">¶</a></dt>
-<dd><p>Associate data with current user session</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>request</strong> &#8211; the request from which session is extracted</li>
-<li><strong>app</strong> (<em>str</em>) &#8211; application name</li>
-<li><strong>key</strong> (<em>str</em>) &#8211; session data key for given application</li>
-<li><strong>value</strong> (<em>object</em>) &#8211; any object that can be pickled can be stored into user session</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-python"><div class="highlight"><pre><span class="n">APPLICATION_KEY</span> <span class="o">=</span> <span class="s">&#39;MyApp&#39;</span>
-<span class="n">SESSION_KEY</span> <span class="o">=</span> <span class="s">&#39;MyFunction&#39;</span>
-
-<span class="k">def</span> <span class="nf">my_function</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
-    <span class="n">value</span> <span class="o">=</span> <span class="p">{</span><span class="s">&#39;key1&#39;</span><span class="p">:</span> <span class="s">&#39;value1&#39;</span><span class="p">,</span> <span class="s">&#39;key2&#39;</span><span class="p">:</span> <span class="s">&#39;value2&#39;</span><span class="p">}</span>
-    <span class="n">set_session_data</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">APPLICATION_KEY</span><span class="p">,</span> <span class="n">SESSION_KEY</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
-</pre></div>
-</div>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.site">
-<span id="pyams-utils-site-module"></span><h2>pyams_utils.site module<a class="headerlink" href="#module-pyams_utils.site" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.site.BaseSiteRoot">
-<em class="property">class </em><code class="descclassname">pyams_utils.site.</code><code class="descname">BaseSiteRoot</code><a class="headerlink" href="#pyams_utils.site.BaseSiteRoot" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.container.folder.Folder</span></code>, <code class="xref py py-class docutils literal"><span class="pre">zope.site.site.SiteManagerContainer</span></code></p>
-<p>Default site root</p>
-<p>A site root can be used as base application root in your ZODB.
-It&#8217;s also site root responsibility to manage your local site manager.</p>
-<p>BaseSiteRoot defines a basic ACL which gives all permissions to system administrator.</p>
-<dl class="attribute">
-<dt id="pyams_utils.site.BaseSiteRoot.config_klass">
-<code class="descname">config_klass</code><em class="property"> = None</em><a class="headerlink" href="#pyams_utils.site.BaseSiteRoot.config_klass" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.site.NewLocalSiteCreatedEvent">
-<em class="property">class </em><code class="descclassname">pyams_utils.site.</code><code class="descname">NewLocalSiteCreatedEvent</code><span class="sig-paren">(</span><em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.site.NewLocalSiteCreatedEvent" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.interface.interfaces.ObjectEvent</span></code></p>
-<p>New local site creation event</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.site.SiteRootEtcTraverser">
-<em class="property">class </em><code class="descclassname">pyams_utils.site.</code><code class="descname">SiteRootEtcTraverser</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.site.SiteRootEtcTraverser" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextAdapter" title="pyams_utils.adapter.ContextAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextAdapter</span></code></a></p>
-<p>Site root ++etc++ namespace traverser</p>
-<p>Gives access to local site manager from <em>/++etc++site</em> URL</p>
-<dl class="method">
-<dt id="pyams_utils.site.SiteRootEtcTraverser.traverse">
-<code class="descname">traverse</code><span class="sig-paren">(</span><em>name</em>, <em>furtherpath=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.site.SiteRootEtcTraverser.traverse" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.site.SiteUpgradeEvent">
-<em class="property">class </em><code class="descclassname">pyams_utils.site.</code><code class="descname">SiteUpgradeEvent</code><span class="sig-paren">(</span><em>object</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.site.SiteUpgradeEvent" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.interface.interfaces.ObjectEvent</span></code></p>
-<p>Site upgrade request event</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.site.check_required_utilities">
-<code class="descclassname">pyams_utils.site.</code><code class="descname">check_required_utilities</code><span class="sig-paren">(</span><em>site</em>, <em>utilities</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.site.check_required_utilities" title="Permalink to this definition">¶</a></dt>
-<dd><p>Utility function to check for required utilities</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>site</strong> (<em>object</em>) &#8211; the site manager into which configuration may be checked</li>
-<li><strong>utilities</strong> (<em>tuple</em>) &#8211; each element of the tuple is another tuple made of the utility interface,
-the utility registration name, the utility factory and the object name when creating the utility, as in:</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-python"><div class="highlight"><pre><span class="n">REQUIRED_UTILITIES</span> <span class="o">=</span> <span class="p">((</span><span class="n">ISecurityManager</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">,</span> <span class="n">SecurityManager</span><span class="p">,</span> <span class="s">&#39;Security manager&#39;</span><span class="p">),</span>
-                      <span class="p">(</span><span class="n">IPrincipalAnnotationUtility</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">,</span> <span class="n">PrincipalAnnotationUtility</span><span class="p">,</span> <span class="s">&#39;User profiles&#39;</span><span class="p">))</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.site.site_factory">
-<code class="descclassname">pyams_utils.site.</code><code class="descname">site_factory</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.site.site_factory" title="Permalink to this definition">¶</a></dt>
-<dd><p>Application site factory</p>
-<p>On application startup, this factory checks configuration to get application name and
-load it from the ZODB; if the application can&#8217;t be found, configuration is scanned to
-get application factory, create a new one and create a local site manager.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.site.site_upgrade">
-<code class="descclassname">pyams_utils.site.</code><code class="descname">site_upgrade</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.site.site_upgrade" title="Permalink to this definition">¶</a></dt>
-<dd><p>Upgrade site when needed</p>
-<p>This function is executed by <em>pyams_upgrade</em> console script.
-Site generations are registered named utilities providing
-<code class="xref py py-class docutils literal"><span class="pre">ISiteGenerations</span></code> interface.</p>
-<p>Current site generations are stored into annotations for each generation adapter.</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.size">
-<span id="pyams-utils-size-module"></span><h2>pyams_utils.size module<a class="headerlink" href="#module-pyams_utils.size" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.size.get_human_size">
-<code class="descclassname">pyams_utils.size.</code><code class="descname">get_human_size</code><span class="sig-paren">(</span><em>value</em>, <em>request=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.size.get_human_size" title="Permalink to this definition">¶</a></dt>
-<dd><p>Convert given bytes value in human readable format</p>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyramid.testing</span> <span class="k">import</span> <span class="n">DummyRequest</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">request</span> <span class="o">=</span> <span class="n">DummyRequest</span><span class="p">(</span><span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s">&#39;_LOCALE_&#39;</span><span class="p">:</span> <span class="s">&#39;en&#39;</span><span class="p">})</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">request</span><span class="o">.</span><span class="n">locale_name</span>
-<span class="go">&#39;en&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.size</span> <span class="k">import</span> <span class="n">get_human_size</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_human_size</span><span class="p">(</span><span class="mi">256</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;256 bytes&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_human_size</span><span class="p">(</span><span class="mi">3678</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;3.6 Kb&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_human_size</span><span class="p">(</span><span class="mi">6785342</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;6.47 Mb&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_human_size</span><span class="p">(</span><span class="mi">3674815342</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;3.422 Gb&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">request</span> <span class="o">=</span> <span class="n">DummyRequest</span><span class="p">(</span><span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s">&#39;_LOCALE_&#39;</span><span class="p">:</span> <span class="s">&#39;fr&#39;</span><span class="p">})</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">request</span><span class="o">.</span><span class="n">locale_name</span>
-<span class="go">&#39;fr&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_human_size</span><span class="p">(</span><span class="mi">256</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;256 bytes&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_human_size</span><span class="p">(</span><span class="mi">3678</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;3,6 Kb&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_human_size</span><span class="p">(</span><span class="mi">6785342</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;6,47 Mb&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_human_size</span><span class="p">(</span><span class="mi">3674815342</span><span class="p">,</span> <span class="n">request</span><span class="p">)</span>
-<span class="go">&#39;3,422 Gb&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.tales">
-<span id="pyams-utils-tales-module"></span><h2>pyams_utils.tales module<a class="headerlink" href="#module-pyams_utils.tales" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.tales.ContextExprMixin">
-<em class="property">class </em><code class="descclassname">pyams_utils.tales.</code><code class="descname">ContextExprMixin</code><a class="headerlink" href="#pyams_utils.tales.ContextExprMixin" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Mixin-class for expression compilers</p>
-<dl class="attribute">
-<dt id="pyams_utils.tales.ContextExprMixin.transform">
-<code class="descname">transform</code><em class="property"> = None</em><a class="headerlink" href="#pyams_utils.tales.ContextExprMixin.transform" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.tales.ExtensionExpr">
-<em class="property">class </em><code class="descclassname">pyams_utils.tales.</code><code class="descname">ExtensionExpr</code><span class="sig-paren">(</span><em>expression</em>, <em>braces_required=False</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.tales.ExtensionExpr" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.tales.ContextExprMixin" title="pyams_utils.tales.ContextExprMixin"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.tales.ContextExprMixin</span></code></a>, <code class="xref py py-class docutils literal"><span class="pre">chameleon.tales.StringExpr</span></code></p>
-<p>extension: TALES expression</p>
-<p>This expression can be used a call a custom named adapter providing ITALESExtension interface.</p>
-<dl class="attribute">
-<dt id="pyams_utils.tales.ExtensionExpr.transform">
-<code class="descname">transform</code><em class="property"> = &lt;Symbol value=&lt;function render_extension&gt; at 7f3cb9015518&gt;</em><a class="headerlink" href="#pyams_utils.tales.ExtensionExpr.transform" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.tales.render_extension">
-<code class="descclassname">pyams_utils.tales.</code><code class="descname">render_extension</code><span class="sig-paren">(</span><em>econtext</em>, <em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.tales.render_extension" title="Permalink to this definition">¶</a></dt>
-<dd><p>TALES extension renderer</p>
-<p>See <a class="reference internal" href="tales.html#tales"><span class="std std-ref">Custom TALES extensions</span></a> for complete description.</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.text">
-<span id="pyams-utils-text-module"></span><h2>pyams_utils.text module<a class="headerlink" href="#module-pyams_utils.text" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.text.BaseHTMLRenderer">
-<em class="property">class </em><code class="descclassname">pyams_utils.text.</code><code class="descname">BaseHTMLRenderer</code><span class="sig-paren">(</span><em>context</em>, <em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.BaseHTMLRenderer" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Raw text HTML renderer</p>
-<p>This renderer renders input text &#8216;as is&#8217;, mainly for use in a &lt;pre&gt; tag.</p>
-<dl class="method">
-<dt id="pyams_utils.text.BaseHTMLRenderer.render">
-<code class="descname">render</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.BaseHTMLRenderer.render" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.text.HTMLTalesExtension">
-<em class="property">class </em><code class="descclassname">pyams_utils.text.</code><code class="descname">HTMLTalesExtension</code><span class="sig-paren">(</span><em>context</em>, <em>request</em>, <em>view</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.HTMLTalesExtension" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextRequestViewAdapter" title="pyams_utils.adapter.ContextRequestViewAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextRequestViewAdapter</span></code></a></p>
-<p><em>extension:html</em> TALES expression</p>
-<p>If first <em>context</em> argument of the renderer is an object for which an <code class="xref py py-class docutils literal"><span class="pre">IHTMLRenderer</span></code>
-can be found, this adapter is used to render the context to HTML; if <em>context</em> is a string,
-it is converted to HTML using the renderer defined as second parameter; otherwise, context is just
-converted to string using the <code class="xref py py-func docutils literal"><span class="pre">str()</span></code> function.</p>
-<dl class="method">
-<dt id="pyams_utils.text.HTMLTalesExtension.render">
-<code class="descname">render</code><span class="sig-paren">(</span><em>context=None</em>, <em>renderer='text'</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.HTMLTalesExtension.render" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.text.ReStructuredTextRenderer">
-<em class="property">class </em><code class="descclassname">pyams_utils.text.</code><code class="descname">ReStructuredTextRenderer</code><span class="sig-paren">(</span><em>context</em>, <em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.ReStructuredTextRenderer" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.text.BaseHTMLRenderer" title="pyams_utils.text.BaseHTMLRenderer"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.text.BaseHTMLRenderer</span></code></a></p>
-<p>reStructuredText HTML renderer</p>
-<p>This renderer is using <em>docutils</em> to render HTML output.</p>
-<dl class="method">
-<dt id="pyams_utils.text.ReStructuredTextRenderer.render">
-<code class="descname">render</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.ReStructuredTextRenderer.render" title="Permalink to this definition">¶</a></dt>
-<dd><p>Render reStructuredText to HTML</p>
-</dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.text.RenderersVocabulary">
-<em class="property">class </em><code class="descclassname">pyams_utils.text.</code><code class="descname">RenderersVocabulary</code><a class="headerlink" href="#pyams_utils.text.RenderersVocabulary" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema.vocabulary.SimpleVocabulary</span></code></p>
-<p>Text renderers vocabulary</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.text.TextRenderer">
-<em class="property">class </em><code class="descclassname">pyams_utils.text.</code><code class="descname">TextRenderer</code><span class="sig-paren">(</span><em>context</em>, <em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.TextRenderer" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.text.BaseHTMLRenderer" title="pyams_utils.text.BaseHTMLRenderer"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.text.BaseHTMLRenderer</span></code></a></p>
-<p>Basic text HTML renderer</p>
-<p>This renderer only replace newlines with HTML breaks.</p>
-<dl class="method">
-<dt id="pyams_utils.text.TextRenderer.render">
-<code class="descname">render</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.TextRenderer.render" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.text.get_text_start">
-<code class="descclassname">pyams_utils.text.</code><code class="descname">get_text_start</code><span class="sig-paren">(</span><em>text</em>, <em>length</em>, <em>max=0</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.get_text_start" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get first words of given text with maximum given length</p>
-<p>If <em>max</em> is specified, text is shortened only if remaining text is longer this value</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>text</strong> (<em>str</em>) &#8211; initial text</li>
-<li><strong>length</strong> (<em>integer</em>) &#8211; maximum length of resulting text</li>
-<li><strong>max</strong> (<em>integer</em>) &#8211; if &gt; 0, <em>text</em> is shortened only if remaining text is longer than max</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.text</span> <span class="k">import</span> <span class="n">get_text_start</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_text_start</span><span class="p">(</span><span class="s">&#39;This is a long string&#39;</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
-<span class="go">&#39;This is a&amp;#133;&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_text_start</span><span class="p">(</span><span class="s">&#39;This is a long string&#39;</span><span class="p">,</span> <span class="mi">20</span><span class="p">)</span>
-<span class="go">&#39;This is a long&amp;#133;&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">get_text_start</span><span class="p">(</span><span class="s">&#39;This is a long string&#39;</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="mi">7</span><span class="p">)</span>
-<span class="go">&#39;This is a long string&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.text.text_to_html">
-<code class="descclassname">pyams_utils.text.</code><code class="descname">text_to_html</code><span class="sig-paren">(</span><em>text</em>, <em>renderer='text'</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.text.text_to_html" title="Permalink to this definition">¶</a></dt>
-<dd><p>Convert text to HTML using the given renderer</p>
-<p>Renderer name can be any registered HTML renderer adapter</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.traversing">
-<span id="pyams-utils-traversing-module"></span><h2>pyams_utils.traversing module<a class="headerlink" href="#module-pyams_utils.traversing" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.traversing.NamespaceTraverser">
-<em class="property">class </em><code class="descclassname">pyams_utils.traversing.</code><code class="descname">NamespaceTraverser</code><span class="sig-paren">(</span><em>root</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.traversing.NamespaceTraverser" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">pyramid.traversal.ResourceTreeTraverser</span></code></p>
-<p>Custom traverser handling views and namespaces</p>
-<p>This is an upgraded version of native Pyramid traverser.
-It adds:
-- a new BeforeTraverseEvent before traversing each object in the path
-- support for namespaces with &#8220;++&#8221; notation</p>
-<dl class="attribute">
-<dt id="pyams_utils.traversing.NamespaceTraverser.NAMESPACE_SELECTOR">
-<code class="descname">NAMESPACE_SELECTOR</code><em class="property"> = '++'</em><a class="headerlink" href="#pyams_utils.traversing.NamespaceTraverser.NAMESPACE_SELECTOR" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.traversing.PathElementsAdapter">
-<em class="property">class </em><code class="descclassname">pyams_utils.traversing.</code><code class="descname">PathElementsAdapter</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.traversing.PathElementsAdapter" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextAdapter" title="pyams_utils.adapter.ContextAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextAdapter</span></code></a></p>
-<p>Contained object path elements adapter</p>
-<p>This interface is intended to be used inside a keyword index to
-be able to search object based on a given parent</p>
-<dl class="attribute">
-<dt id="pyams_utils.traversing.PathElementsAdapter.parents">
-<code class="descname">parents</code><a class="headerlink" href="#pyams_utils.traversing.PathElementsAdapter.parents" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.traversing.get_parent">
-<code class="descclassname">pyams_utils.traversing.</code><code class="descname">get_parent</code><span class="sig-paren">(</span><em>context</em>, <em>interface=&lt;InterfaceClass zope.interface.Interface&gt;</em>, <em>allow_context=True</em>, <em>condition=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.traversing.get_parent" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get first parent of the context that implements given interface</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>context</strong> (<em>object</em>) &#8211; base element</li>
-<li><strong>interface</strong> (<em>Interface</em>) &#8211; the interface that parend should implement</li>
-<li><strong>allow_context</strong> (<em>boolean</em>) &#8211; if &#8216;True&#8217; (the default), traversing is done starting with context; otherwise,
-traversing is done starting from context&#8217;s parent</li>
-<li><strong>condition</strong> (<em>callable</em>) &#8211; an optional function that should return a &#8216;True&#8217; result when called with parent
-as first argument</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.unicode">
-<span id="pyams-utils-unicode-module"></span><h2>pyams_utils.unicode module<a class="headerlink" href="#module-pyams_utils.unicode" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.unicode.decode">
-<code class="descclassname">pyams_utils.unicode.</code><code class="descname">decode</code><span class="sig-paren">(</span><em>value</em>, <em>encoding='utf-8'</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.unicode.decode" title="Permalink to this definition">¶</a></dt>
-<dd><p>Decode given bytes value to unicode with given encoding</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 simple">
-<li><strong>value</strong> (<em>bytes</em>) &#8211; the value to decode</li>
-<li><strong>encoding</strong> (<em>str</em>) &#8211; selected encoding</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">str; value decoded to unicode string if input is a bytes, original value otherwise</p>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.unicode</span> <span class="k">import</span> <span class="n">decode</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">decode</span><span class="p">(</span><span class="n">b</span><span class="s">&#39;Cha</span><span class="se">\xc3\xae</span><span class="s">ne accentu</span><span class="se">\xc3\xa9</span><span class="s">e&#39;</span><span class="p">)</span>
-<span class="go">&#39;Chaîne accentuée&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">decode</span><span class="p">(</span><span class="n">b</span><span class="s">&#39;Cha</span><span class="se">\xee</span><span class="s">ne accentu</span><span class="se">\xe9</span><span class="s">e&#39;</span><span class="p">,</span> <span class="s">&#39;latin1&#39;</span><span class="p">)</span>
-<span class="go">&#39;Chaîne accentuée&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.unicode.encode">
-<code class="descclassname">pyams_utils.unicode.</code><code class="descname">encode</code><span class="sig-paren">(</span><em>value</em>, <em>encoding='utf-8'</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.unicode.encode" title="Permalink to this definition">¶</a></dt>
-<dd><p>Encode given Unicode value to bytes with given encoding</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 simple">
-<li><strong>value</strong> (<em>str</em>) &#8211; the value to encode</li>
-<li><strong>encoding</strong> (<em>str</em>) &#8211; selected encoding</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">bytes; value encoded to bytes if input is a string, original value otherwise</p>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.unicode</span> <span class="k">import</span> <span class="n">encode</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">encode</span><span class="p">(</span><span class="s">&#39;Chaîne accentuée&#39;</span><span class="p">)</span>
-<span class="go">b&#39;Cha\xc3\xaene accentu\xc3\xa9e&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">encode</span><span class="p">(</span><span class="s">&#39;Chaîne accentuée&#39;</span><span class="p">,</span> <span class="s">&#39;latin1&#39;</span><span class="p">)</span>
-<span class="go">b&#39;Cha\xeene accentu\xe9e&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.unicode.nvl">
-<code class="descclassname">pyams_utils.unicode.</code><code class="descname">nvl</code><span class="sig-paren">(</span><em>value</em>, <em>default=''</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.unicode.nvl" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get specified value, or an empty string if value is empty</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 simple">
-<li><strong>value</strong> (<em>object</em>) &#8211; value to be checked</li>
-<li><strong>default</strong> (<em>object</em>) &#8211; default value to be returned if value is <em>false</em></li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">input value, or <em>default</em> if value is <em>false</em></p>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.unicode</span> <span class="k">import</span> <span class="n">nvl</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">nvl</span><span class="p">(</span><span class="k">None</span><span class="p">)</span>
-<span class="go">&#39;&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">nvl</span><span class="p">(</span><span class="s">&#39;foo&#39;</span><span class="p">)</span>
-<span class="go">&#39;foo&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">nvl</span><span class="p">(</span><span class="k">False</span><span class="p">,</span> <span class="s">&#39;bar&#39;</span><span class="p">)</span>
-<span class="go">&#39;bar&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.unicode.translate_string">
-<code class="descclassname">pyams_utils.unicode.</code><code class="descname">translate_string</code><span class="sig-paren">(</span><em>s</em>, <em>escape_slashes=False</em>, <em>force_lower=True</em>, <em>spaces=' '</em>, <em>remove_punctuation=True</em>, <em>keep_chars='_-.'</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.unicode.translate_string" title="Permalink to this definition">¶</a></dt>
-<dd><p>Remove extended characters and diacritics from string and replace them with &#8216;basic&#8217; ones</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 simple">
-<li><strong>s</strong> (<em>str</em>) &#8211; text to be cleaned.</li>
-<li><strong>escape_slashes</strong> (<em>boolean</em>) &#8211; if True, slashes are also converted</li>
-<li><strong>force_lower</strong> (<em>boolean</em>) &#8211; if True, result is automatically converted to lower case</li>
-<li><strong>spaces</strong> (<em>str</em>) &#8211; character used to replace spaces</li>
-<li><strong>remove_punctuation</strong> (<em>boolean</em>) &#8211; if True, all punctuation characters are removed</li>
-<li><strong>keep_chars</strong> (<em>str</em>) &#8211; characters which may be kept in the input string</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">text without diacritics or special characters</p>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.unicode</span> <span class="k">import</span> <span class="n">translate_string</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="nb">input</span> <span class="o">=</span> <span class="s">&#39;Ceci est un test en Français !!!&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">translate_string</span><span class="p">(</span><span class="nb">input</span><span class="p">)</span>
-<span class="go">&#39;ceci est un test en francais&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">translate_string</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">force_lower</span><span class="o">=</span><span class="k">False</span><span class="p">)</span>
-<span class="go">&#39;Ceci est un test en Francais&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">translate_string</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">spaces</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">)</span>
-<span class="go">&#39;ceci-est-un-test-en-francais&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">translate_string</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">remove_punctuation</span><span class="o">=</span><span class="k">False</span><span class="p">)</span>
-<span class="go">&#39;ceci est un test en francais !!!&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">translate_string</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">keep_chars</span><span class="o">=</span><span class="s">&#39;!&#39;</span><span class="p">)</span>
-<span class="go">&#39;ceci est un test en francais !!!&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.unicode.unidict">
-<code class="descclassname">pyams_utils.unicode.</code><code class="descname">unidict</code><span class="sig-paren">(</span><em>value</em>, <em>encoding='utf-8'</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.unicode.unidict" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get specified dict with values converted to unicode</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>value</strong> (<em>dict</em>) &#8211; input mapping of strings which may be converted to unicode</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">dict; a new mapping with each value converted to unicode</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.unicode</span> <span class="k">import</span> <span class="n">unidict</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">unidict</span><span class="p">({</span><span class="s">&#39;input&#39;</span><span class="p">:</span> <span class="n">b</span><span class="s">&#39;Cha</span><span class="se">\xc3\xae</span><span class="s">ne accentu</span><span class="se">\xc3\xa9</span><span class="s">e&#39;</span><span class="p">})</span>
-<span class="go">{&#39;input&#39;: &#39;Chaîne accentuée&#39;}</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">unidict</span><span class="p">({</span><span class="s">&#39;input&#39;</span><span class="p">:</span> <span class="n">b</span><span class="s">&#39;Cha</span><span class="se">\xee</span><span class="s">ne accentu</span><span class="se">\xe9</span><span class="s">e&#39;</span><span class="p">},</span> <span class="s">&#39;latin1&#39;</span><span class="p">)</span>
-<span class="go">{&#39;input&#39;: &#39;Chaîne accentuée&#39;}</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.unicode.unilist">
-<code class="descclassname">pyams_utils.unicode.</code><code class="descname">unilist</code><span class="sig-paren">(</span><em>value</em>, <em>encoding='utf-8'</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.unicode.unilist" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get specified list with values converted to unicode</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>value</strong> (<a class="reference internal" href="#module-pyams_utils.list" title="pyams_utils.list"><em>list</em></a>) &#8211; input list of strings which may be converted to unicode</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list; a new list with each value converted to unicode</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.unicode</span> <span class="k">import</span> <span class="n">unilist</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">unilist</span><span class="p">([</span><span class="n">b</span><span class="s">&#39;Cha</span><span class="se">\xc3\xae</span><span class="s">ne accentu</span><span class="se">\xc3\xa9</span><span class="s">e&#39;</span><span class="p">])</span>
-<span class="go">[&#39;Chaîne accentuée&#39;]</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">unilist</span><span class="p">([</span><span class="n">b</span><span class="s">&#39;Cha</span><span class="se">\xee</span><span class="s">ne accentu</span><span class="se">\xe9</span><span class="s">e&#39;</span><span class="p">],</span> <span class="s">&#39;latin1&#39;</span><span class="p">)</span>
-<span class="go">[&#39;Chaîne accentuée&#39;]</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.unicode.uninvl">
-<code class="descclassname">pyams_utils.unicode.</code><code class="descname">uninvl</code><span class="sig-paren">(</span><em>value</em>, <em>default=''</em>, <em>encoding='utf-8'</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.unicode.uninvl" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get specified value converted to unicode, or an empty unicode string if value is empty</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 simple">
-<li><strong>value</strong> (<em>str/bytes</em>) &#8211; the input to be checked</li>
-<li><strong>default</strong> &#8211; str; default value</li>
-<li><strong>encoding</strong> &#8211; str; encoding name to use for conversion</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">str; value, or <em>default</em> if value is empty, converted to unicode</p>
-</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.unicode</span> <span class="k">import</span> <span class="n">uninvl</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">uninvl</span><span class="p">(</span><span class="s">&#39;String value&#39;</span><span class="p">)</span>
-<span class="go">&#39;String value&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">uninvl</span><span class="p">(</span><span class="n">b</span><span class="s">&#39;String value&#39;</span><span class="p">)</span>
-<span class="go">&#39;String value&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">uninvl</span><span class="p">(</span><span class="n">b</span><span class="s">&#39;Cha</span><span class="se">\xc3\xae</span><span class="s">ne accentu</span><span class="se">\xc3\xa9</span><span class="s">e&#39;</span><span class="p">)</span>
-<span class="go">&#39;Chaîne accentuée&#39;</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">uninvl</span><span class="p">(</span><span class="n">b</span><span class="s">&#39;Cha</span><span class="se">\xee</span><span class="s">ne accentu</span><span class="se">\xe9</span><span class="s">e&#39;</span><span class="p">,</span> <span class="s">&#39;latin1&#39;</span><span class="p">)</span>
-<span class="go">&#39;Chaîne accentuée&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.unicode.utf8">
-<code class="descclassname">pyams_utils.unicode.</code><code class="descname">utf8</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.unicode.utf8" title="Permalink to this definition">¶</a></dt>
-<dd><p>Encode given unicode value to UTF-8 encoded bytes</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>value</strong> (<em>str</em>) &#8211; the value to encode to utf-8</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">bytes; value encoded to bytes if input is a string, original value otherwise</td>
-</tr>
-</tbody>
-</table>
-<div class="highlight-default"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyams_utils.unicode</span> <span class="k">import</span> <span class="n">utf8</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">utf8</span><span class="p">(</span><span class="s">&#39;Chaîne accentuée&#39;</span><span class="p">)</span>
-<span class="go">b&#39;Cha\xc3\xaene accentu\xc3\xa9e&#39;</span>
-</pre></div>
-</div>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.url">
-<span id="pyams-utils-url-module"></span><h2>pyams_utils.url module<a class="headerlink" href="#module-pyams_utils.url" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.url.AbsoluteUrlTalesExtension">
-<em class="property">class </em><code class="descclassname">pyams_utils.url.</code><code class="descname">AbsoluteUrlTalesExtension</code><span class="sig-paren">(</span><em>context</em>, <em>request</em>, <em>view</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.url.AbsoluteUrlTalesExtension" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.adapter.ContextRequestViewAdapter" title="pyams_utils.adapter.ContextRequestViewAdapter"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.adapter.ContextRequestViewAdapter</span></code></a></p>
-<p>extension:absolute_url(context, view_name) TALES extension</p>
-<p>A PyAMS TALES extension used to get access to an object URL from a page template.</p>
-<dl class="method">
-<dt id="pyams_utils.url.AbsoluteUrlTalesExtension.render">
-<code class="descname">render</code><span class="sig-paren">(</span><em>context=None</em>, <em>view_name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.url.AbsoluteUrlTalesExtension.render" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.url.absolute_url">
-<code class="descclassname">pyams_utils.url.</code><code class="descname">absolute_url</code><span class="sig-paren">(</span><em>context</em>, <em>request</em>, <em>view_name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.url.absolute_url" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get resource absolute_url</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>context</strong> (<em>object</em>) &#8211; the persistent object for which absolute URL is required</li>
-<li><strong>request</strong> &#8211; the request on which URL is based</li>
-<li><strong>view_name</strong> (<em>str</em>) &#8211; an optional view name to add to URL</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<p>This absolute URL function is based on default Pyramid&#8217;s <code class="xref py py-func docutils literal"><span class="pre">resource_url()</span></code> function, but
-add checks to remove some double slashes, and add control on view name when it begins with a &#8216;#&#8217;
-character which is used by MyAMS.js framework.</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.vocabulary">
-<span id="pyams-utils-vocabulary-module"></span><h2>pyams_utils.vocabulary module<a class="headerlink" href="#module-pyams_utils.vocabulary" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.vocabulary.vocabulary_config">
-<em class="property">class </em><code class="descclassname">pyams_utils.vocabulary.</code><code class="descname">vocabulary_config</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.vocabulary.vocabulary_config" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>Class decorator to define a vocabulary</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>name</strong> (<em>str</em>) &#8211; name of the registered vocabulary</td>
-</tr>
-</tbody>
-</table>
-<p>This is, for example, how a vocabulary of registered ZEO connections utilities is created:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pyams_utils.interfaces.zeo</span> <span class="kn">import</span> <span class="n">IZEOConnection</span>
-
-<span class="kn">from</span> <span class="nn">pyams_utils.registry</span> <span class="kn">import</span> <span class="n">get_utilities_for</span>
-<span class="kn">from</span> <span class="nn">pyams_utils.vocabulary</span> <span class="kn">import</span> <span class="n">vocabulary_config</span>
-<span class="kn">from</span> <span class="nn">zope.schema.vocabulary</span> <span class="kn">import</span> <span class="n">SimpleTerm</span><span class="p">,</span> <span class="n">SimpleVocabulary</span>
-
-<span class="nd">@vocabulary_config</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;PyAMS ZEO connections&#39;</span><span class="p">)</span>
-<span class="k">class</span> <span class="nc">ZEOConnectionVocabulary</span><span class="p">(</span><span class="n">SimpleVocabulary</span><span class="p">):</span>
-    <span class="sd">&#39;&#39;&#39;ZEO connections vocabulary&#39;&#39;&#39;</span>
-
-    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
-        <span class="n">terms</span> <span class="o">=</span> <span class="p">[</span><span class="n">SimpleTerm</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">util</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> <span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">util</span> <span class="ow">in</span> <span class="n">get_utilities_for</span><span class="p">(</span><span class="n">IZEOConnection</span><span class="p">)]</span>
-        <span class="nb">super</span><span class="p">(</span><span class="n">ZEOConnectionVocabulary</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">terms</span><span class="p">)</span>
-</pre></div>
-</div>
-<p>You can then use such a vocabulary in any schema field:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">zope.interface</span> <span class="kn">import</span> <span class="n">Interface</span>
-<span class="kn">from</span> <span class="nn">zope.schema</span> <span class="kn">import</span> <span class="n">Choice</span>
-
-<span class="k">class</span> <span class="nc">MySchema</span><span class="p">(</span><span class="n">Interface</span><span class="p">):</span>
-    <span class="sd">&#39;&#39;&#39;Custom schema interface&#39;&#39;&#39;</span>
-
-    <span class="n">zeo_connection_name</span> <span class="o">=</span> <span class="n">Choice</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s">&#39;ZEO connection name&#39;</span><span class="p">,</span>
-                                 <span class="n">description</span><span class="o">=</span><span class="s">&#39;Please select a registered ZEO connection&#39;</span><span class="p">,</span>
-                                 <span class="n">vocabulary</span><span class="o">=</span><span class="s">&#39;PyAMS ZEO connections&#39;</span><span class="p">,</span>
-                                 <span class="n">required</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
-</pre></div>
-</div>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.wsgi">
-<span id="pyams-utils-wsgi-module"></span><h2>pyams_utils.wsgi module<a class="headerlink" href="#module-pyams_utils.wsgi" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.wsgi.wsgi_environ_cache">
-<code class="descclassname">pyams_utils.wsgi.</code><code class="descname">wsgi_environ_cache</code><span class="sig-paren">(</span><em>*names</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.wsgi.wsgi_environ_cache" title="Permalink to this definition">¶</a></dt>
-<dd><p>Wrap a function/method to cache its result for call into request.environ</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>names</strong> (<em>[string...]</em>) &#8211; keys to cache into environ; len(names) must
-be equal to the result&#8217;s length or scalar</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils.zodb">
-<span id="pyams-utils-zodb-module"></span><h2>pyams_utils.zodb module<a class="headerlink" href="#module-pyams_utils.zodb" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pyams_utils.zodb.ZEOConnection">
-<em class="property">class </em><code class="descclassname">pyams_utils.zodb.</code><code class="descname">ZEOConnection</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
-<p>ZEO connection object</p>
-<p>This object can be used to store all settings to be able to open a ZEO connection.</p>
-<p>Note that a ZEO connection object is a context manager, so you can use it like this:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pyams_utils.zodb</span> <span class="kn">import</span> <span class="n">ZEOConnection</span>
-
-<span class="k">def</span> <span class="nf">my_method</span><span class="p">(</span><span class="n">zeo_settings</span><span class="p">):</span>
-    <span class="n">zeo_connection</span> <span class="o">=</span> <span class="n">ZEOConnection</span><span class="p">()</span>
-    <span class="n">zeo_connection</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">zeo_settings</span><span class="p">)</span>
-    <span class="k">with</span> <span class="n">zeo_connection</span> <span class="k">as</span> <span class="n">root</span><span class="p">:</span>
-        <span class="c"># *root* is then the ZODB root object</span>
-        <span class="c"># do whatever you want with ZEO connection,</span>
-        <span class="c"># which is closed automatically</span>
-</pre></div>
-</div>
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.blob_dir">
-<code class="descname">blob_dir</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.blob_dir" title="Permalink to this definition">¶</a></dt>
-<dd><p>Directory path for blob data</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.connection">
-<code class="descname">connection</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.connection" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.zodb.ZEOConnection.get_connection">
-<code class="descname">get_connection</code><span class="sig-paren">(</span><em>wait=False</em>, <em>get_storage=False</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.get_connection" title="Permalink to this definition">¶</a></dt>
-<dd><p>Create ZEO client connection from current settings</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 simple">
-<li><strong>wait</strong> (<em>boolean</em>) &#8211; should connection wait until storage is ready</li>
-<li><strong>get_storage</strong> (<em>boolean</em>) &#8211; if <em>True</em>, the method should return a tuple containing
-storage and DB objects; otherwise only DB object is returned</li>
-</ul>
-</td>
-</tr>
-<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">tuple containing ZEO client storage and DB object (if <em>get_storage</em> argument is
-set to <em>True</em>), or only DB object otherwise</p>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.zodb.ZEOConnection.get_settings">
-<code class="descname">get_settings</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.get_settings" title="Permalink to this definition">¶</a></dt>
-<dd><p>Get mapping of all connection settings</p>
-<p>These settings can be converted to JSON and sent to another process, for example
-via a ØMQ connection.</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">Returns:</th><td class="field-body">dict</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.name">
-<code class="descname">name</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.name" title="Permalink to this definition">¶</a></dt>
-<dd><p>Registration name of ZEO connection</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.password">
-<code class="descname">password</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.password" title="Permalink to this definition">¶</a></dt>
-<dd><p>User password on ZEO server</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.server_name">
-<code class="descname">server_name</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.server_name" title="Permalink to this definition">¶</a></dt>
-<dd><p>Hostname of ZEO server</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.server_port">
-<code class="descname">server_port</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.server_port" title="Permalink to this definition">¶</a></dt>
-<dd><p>Port number of ZEO server</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.server_realm">
-<code class="descname">server_realm</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.server_realm" title="Permalink to this definition">¶</a></dt>
-<dd><p>Realm name on ZEO server</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.shared_blob_dir">
-<code class="descname">shared_blob_dir</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.shared_blob_dir" title="Permalink to this definition">¶</a></dt>
-<dd><p>Flag whether the blob_dir is a server-shared filesystem that should be used instead of transferring blob data over zrpc.</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.storage">
-<code class="descname">storage</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.storage" title="Permalink to this definition">¶</a></dt>
-<dd><p>Storage name on ZEO server</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="pyams_utils.zodb.ZEOConnection.update">
-<code class="descname">update</code><span class="sig-paren">(</span><em>settings</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.update" title="Permalink to this definition">¶</a></dt>
-<dd><p>Update connection properties with settings as <em>dict</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>settings</strong> (<em>dict</em>) &#8211; typically extracted via the <a class="reference internal" href="#pyams_utils.zodb.ZEOConnection.get_settings" title="pyams_utils.zodb.ZEOConnection.get_settings"><code class="xref py py-meth docutils literal"><span class="pre">get_settings()</span></code></a> method from
-another process</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pyams_utils.zodb.ZEOConnection.username">
-<code class="descname">username</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnection.username" title="Permalink to this definition">¶</a></dt>
-<dd><p>User name on ZEO server</p>
-</dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.zodb.ZEOConnectionUtility">
-<em class="property">class </em><code class="descclassname">pyams_utils.zodb.</code><code class="descname">ZEOConnectionUtility</code><a class="headerlink" href="#pyams_utils.zodb.ZEOConnectionUtility" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <a class="reference internal" href="#pyams_utils.zodb.ZEOConnection" title="pyams_utils.zodb.ZEOConnection"><code class="xref py py-class docutils literal"><span class="pre">pyams_utils.zodb.ZEOConnection</span></code></a>, <code class="xref py py-class docutils literal"><span class="pre">persistent.Persistent</span></code>, <code class="xref py py-class docutils literal"><span class="pre">zope.container.contained.Contained</span></code></p>
-<p>Persistent ZEO connection utility</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pyams_utils.zodb.ZEOConnectionVocabulary">
-<em class="property">class </em><code class="descclassname">pyams_utils.zodb.</code><code class="descname">ZEOConnectionVocabulary</code><span class="sig-paren">(</span><em>context=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.zodb.ZEOConnectionVocabulary" title="Permalink to this definition">¶</a></dt>
-<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">zope.schema.vocabulary.SimpleVocabulary</span></code></p>
-<p>ZEO connections vocabulary</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.zodb.get_connection">
-<code class="descclassname">pyams_utils.zodb.</code><code class="descname">get_connection</code><span class="sig-paren">(</span><em>obj</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.zodb.get_connection" title="Permalink to this definition">¶</a></dt>
-<dd><p>An adapter which gets a ZODB connection from a persistent object</p>
-<p>We are assuming the object has a parent if it has been created in
-this transaction.</p>
-<p>Raises ValueError if it is impossible to get a connection.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.zodb.get_connection_from_settings">
-<code class="descclassname">pyams_utils.zodb.</code><code class="descname">get_connection_from_settings</code><span class="sig-paren">(</span><em>settings</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.zodb.get_connection_from_settings" title="Permalink to this definition">¶</a></dt>
-<dd><p>Load connection matching registry settings</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.zodb.get_transaction_manager">
-<code class="descclassname">pyams_utils.zodb.</code><code class="descname">get_transaction_manager</code><span class="sig-paren">(</span><em>obj</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.zodb.get_transaction_manager" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.zodb.handle_added_connection">
-<code class="descclassname">pyams_utils.zodb.</code><code class="descname">handle_added_connection</code><span class="sig-paren">(</span><em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.zodb.handle_added_connection" title="Permalink to this definition">¶</a></dt>
-<dd><p>Register new ZEO connection when added</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pyams_utils.zodb.handle_removed_connection">
-<code class="descclassname">pyams_utils.zodb.</code><code class="descname">handle_removed_connection</code><span class="sig-paren">(</span><em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.zodb.handle_removed_connection" title="Permalink to this definition">¶</a></dt>
-<dd><p>Un-register ZEO connection when deleted</p>
-</dd></dl>
-
-</div>
-<div class="section" id="module-pyams_utils">
-<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pyams_utils" title="Permalink to this headline">¶</a></h2>
-<dl class="function">
-<dt id="pyams_utils.includeme">
-<code class="descclassname">pyams_utils.</code><code class="descname">includeme</code><span class="sig-paren">(</span><em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#pyams_utils.includeme" title="Permalink to this definition">¶</a></dt>
-<dd><p>pyams_utils features include</p>
-</dd></dl>
-
-</div>
-</div>
-
-
-          </div>
-        </div>
-      </div>
-      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
-        <div class="sphinxsidebarwrapper">
-  <h3><a href="index.html">Table Of Contents</a></h3>
-  <ul>
-<li><a class="reference internal" href="#">pyams_utils package</a><ul>
-<li><a class="reference internal" href="#subpackages">Subpackages</a></li>
-<li><a class="reference internal" href="#submodules">Submodules</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.adapter">pyams_utils.adapter module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.attr">pyams_utils.attr module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.container">pyams_utils.container module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.context">pyams_utils.context module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.data">pyams_utils.data module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.date">pyams_utils.date module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.decorator">pyams_utils.decorator module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.encoding">pyams_utils.encoding module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.html">pyams_utils.html module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.i18n">pyams_utils.i18n module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.include">pyams_utils.include module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.intids">pyams_utils.intids module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.list">pyams_utils.list module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.lock">pyams_utils.lock module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.progress">pyams_utils.progress module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.property">pyams_utils.property module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.registry">pyams_utils.registry module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.request">pyams_utils.request module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.schema">pyams_utils.schema module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.session">pyams_utils.session module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.site">pyams_utils.site module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.size">pyams_utils.size module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.tales">pyams_utils.tales module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.text">pyams_utils.text module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.traversing">pyams_utils.traversing module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.unicode">pyams_utils.unicode module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.url">pyams_utils.url module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.vocabulary">pyams_utils.vocabulary module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.wsgi">pyams_utils.wsgi module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils.zodb">pyams_utils.zodb module</a></li>
-<li><a class="reference internal" href="#module-pyams_utils">Module contents</a></li>
-</ul>
-</li>
-</ul>
-
-<div id="searchbox" style="display: none" role="search">
-  <h3>Quick search</h3>
-    <form class="search" action="search.html" method="get">
-      <div><input type="text" name="q" /></div>
-      <div><input type="submit" value="Go" /></div>
-      <input type="hidden" name="check_keywords" value="yes" />
-      <input type="hidden" name="area" value="default" />
-    </form>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
-        </div>
-      </div>
-      <div class="clearer"></div>
-    </div>
-    <div class="related" role="navigation" aria-label="related navigation">
-      <h3>Navigation</h3>
-      <ul>
-        <li class="right" style="margin-right: 10px">
-          <a href="genindex.html" title="General Index"
-             >index</a></li>
-        <li class="right" >
-          <a href="py-modindex.html" title="Python Module Index"
-             >modules</a> |</li>
-        <li class="nav-item nav-item-0"><a href="index.html">PyAMS_utils 0.1.4 documentation</a> &#187;</li> 
-      </ul>
-    </div>
-    <div class="footer" role="contentinfo">
-        &#169; Copyright 2016, Thierry Florac &lt;tflorac@ulthar.net&gt;.
-      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.
-    </div>
-  </body>
-</html>
\ No newline at end of file