python-feedgen/api.util.html

109 lines
5.2 KiB
HTML
Raw Normal View History

2018-05-19 22:07:44 +02:00
2013-05-05 22:12:47 +02:00
<!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>
2018-06-03 10:41:51 +02:00
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
2013-05-05 22:12:47 +02:00
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2019-09-08 12:41:26 +02:00
<title>feedgen.util &#8212; python-feedgen 0.8.0 documentation</title>
2013-05-05 22:12:47 +02:00
<link rel="stylesheet" href="_static/lernfunk.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
2019-09-08 12:41:26 +02:00
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
2013-05-05 22:12:47 +02:00
<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>
2019-09-08 12:41:26 +02:00
<script type="text/javascript" src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
2013-05-05 22:12:47 +02:00
<link rel="next" title="feedgen.ext.base" href="ext/api.ext.base.html" />
<link rel="prev" title="feedgen.entry" href="api.entry.html" />
2018-06-03 10:41:51 +02:00
</head><body>
<div class="header" role="banner"><h1 class="heading"><a href="index.html">
2019-09-08 12:41:26 +02:00
<span>python-feedgen 0.8.0 documentation</span></a></h1>
2013-05-05 22:12:47 +02:00
<h2 class="heading"><span>feedgen.util</span></h2>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
2013-05-05 22:12:47 +02:00
<p>
«&#160;&#160;<a href="api.entry.html">feedgen.entry</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="ext/api.ext.base.html">feedgen.ext.base</a>&#160;&#160;»
</p>
</div>
<div class="content">
2016-09-04 21:54:21 +02:00
<script type=application/javascript src=_static/theme_extras.js></script>
<div class="apititle"><b>Contents</b></div>
2013-05-05 22:12:47 +02:00
<div class="apitoc"></div><span class="target" id="module-feedgen.util"></span><div class="section" id="feedgen-util">
<h1>feedgen.util<a class="headerlink" href="#feedgen-util" title="Permalink to this headline"></a></h1>
<p>This file contains helper functions for the feed generator module.</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">copyright:</th><td class="field-body">2013, Lars Kiesow &lt;<a class="reference external" href="mailto:lkiesow&#37;&#52;&#48;uos&#46;de">lkiesow<span>&#64;</span>uos<span>&#46;</span>de</a>&gt;</td>
</tr>
<tr class="field-even field"><th class="field-name">license:</th><td class="field-body">FreeBSD and LGPL, see license.* for more details.</td>
</tr>
</tbody>
</table>
<dl class="function">
<dt id="feedgen.util.ensure_format">
<code class="descclassname">feedgen.util.</code><code class="descname">ensure_format</code><span class="sig-paren">(</span><em>val</em>, <em>allowed</em>, <em>required</em>, <em>allowed_values=None</em>, <em>defaults=None</em><span class="sig-paren">)</span><a class="headerlink" href="#feedgen.util.ensure_format" title="Permalink to this definition"></a></dt>
2013-05-05 22:12:47 +02:00
<dd><p>Takes a dictionary or a list of dictionaries and check if all keys are in
the set of allowed keys, if all required keys are present and if the values
of a specific key are ok.</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">
2018-05-19 22:07:44 +02:00
<li><strong>val</strong> Dictionaries to check.</li>
<li><strong>allowed</strong> Set of allowed keys.</li>
<li><strong>required</strong> Set of required keys.</li>
<li><strong>allowed_values</strong> Dictionary with keys and sets of their allowed
values.</li>
2018-05-19 22:07:44 +02:00
<li><strong>defaults</strong> Dictionary with default values.</li>
2013-05-05 22:12:47 +02:00
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">List of checked dictionaries.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
2016-09-04 21:54:21 +02:00
<dl class="function">
<dt id="feedgen.util.formatRFC2822">
2018-05-19 22:07:44 +02:00
<code class="descclassname">feedgen.util.</code><code class="descname">formatRFC2822</code><span class="sig-paren">(</span><em>date</em><span class="sig-paren">)</span><a class="headerlink" href="#feedgen.util.formatRFC2822" title="Permalink to this definition"></a></dt>
2016-09-04 21:54:21 +02:00
<dd><p>Make sure the locale setting do not interfere with the time format.</p>
</dd></dl>
2013-05-05 22:12:47 +02:00
</div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
2013-05-05 22:12:47 +02:00
<p>
«&#160;&#160;<a href="api.entry.html">feedgen.entry</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="ext/api.ext.base.html">feedgen.ext.base</a>&#160;&#160;»
</p>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2013-2016, Lars Kiesow.
2019-09-08 12:41:26 +02:00
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.4.
2013-05-05 22:12:47 +02:00
</div>
</body>
</html>