python-feedgen/api.util.html

104 lines
5.6 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>feedgen.util &#8212; python-feedgen 1.0.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/lernfunk.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="feedgen.ext.base" href="ext/api.ext.base.html" />
<link rel="prev" title="feedgen.entry" href="api.entry.html" />
</head><body>
<div class="header" role="banner"><h1 class="heading"><a href="index.html">
<span>python-feedgen 1.0.0 documentation</span></a></h1>
<h2 class="heading"><span>feedgen.util</span></h2>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<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" role="main">
<script type=application/javascript src=_static/theme_extras.js></script>
<div class="apititle"><b>Contents</b></div>
<div class="apitoc"></div><span class="target" id="module-feedgen.util"></span><section id="feedgen-util">
<h1>feedgen.util<a class="headerlink" href="#feedgen-util" title="Permalink to this heading"></a></h1>
<p>This file contains helper functions for the feed generator module.</p>
<dl class="field-list simple">
<dt class="field-odd">copyright<span class="colon">:</span></dt>
<dd class="field-odd"><p>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;</p>
</dd>
<dt class="field-even">license<span class="colon">:</span></dt>
<dd class="field-even"><p>FreeBSD and LGPL, see license.* for more details.</p>
</dd>
</dl>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="feedgen.util.ensure_format">
<span class="sig-prename descclassname"><span class="pre">feedgen.util.</span></span><span class="sig-name descname"><span class="pre">ensure_format</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allowed</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allowed_values</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">defaults</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#feedgen.util.ensure_format" title="Permalink to this definition"></a></dt>
<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>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>val</strong> Dictionaries to check.</p></li>
<li><p><strong>allowed</strong> Set of allowed keys.</p></li>
<li><p><strong>required</strong> Set of required keys.</p></li>
<li><p><strong>allowed_values</strong> Dictionary with keys and sets of their allowed
values.</p></li>
<li><p><strong>defaults</strong> Dictionary with default values.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of checked dictionaries.</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="feedgen.util.formatRFC2822">
<span class="sig-prename descclassname"><span class="pre">feedgen.util.</span></span><span class="sig-name descname"><span class="pre">formatRFC2822</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">date</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#feedgen.util.formatRFC2822" title="Permalink to this definition"></a></dt>
<dd><p>Make sure the locale setting do not interfere with the time format.</p>
</dd></dl>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<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.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
</div>
</body>
</html>