/usr/share/doc/python-werkzeug-doc/html/contrib/atom.html is in python-werkzeug-doc 0.10.4+dfsg1-1ubuntu1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | <!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>Atom Syndication — Werkzeug 0.10.4 documentation</title>
<link rel="stylesheet" href="../_static/werkzeug.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.10.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="top" title="Werkzeug 0.10.4 documentation" href="../index.html" />
<link rel="up" title="Contributed Modules" href="index.html" />
<link rel="next" title="Sessions" href="sessions.html" />
<link rel="prev" title="Contributed Modules" href="index.html" />
</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="right" >
<a href="sessions.html" title="Sessions"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Contributed Modules"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Werkzeug 0.10.4 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Contributed Modules</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-werkzeug.contrib.atom">
<span id="atom-syndication"></span><h1>Atom Syndication<a class="headerlink" href="#module-werkzeug.contrib.atom" title="Permalink to this headline">¶</a></h1>
<p>This module provides a class called <a class="reference internal" href="#werkzeug.contrib.atom.AtomFeed" title="werkzeug.contrib.atom.AtomFeed"><code class="xref py py-class docutils literal"><span class="pre">AtomFeed</span></code></a> which can be
used to generate feeds in the Atom syndication format (see <span class="target" id="index-0"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc4287.html"><strong>RFC 4287</strong></a>).</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">atom_feed</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
<span class="n">feed</span> <span class="o">=</span> <span class="n">AtomFeed</span><span class="p">(</span><span class="s2">"My Blog"</span><span class="p">,</span> <span class="n">feed_url</span><span class="o">=</span><span class="n">request</span><span class="o">.</span><span class="n">url</span><span class="p">,</span>
<span class="n">url</span><span class="o">=</span><span class="n">request</span><span class="o">.</span><span class="n">host_url</span><span class="p">,</span>
<span class="n">subtitle</span><span class="o">=</span><span class="s2">"My example blog for a feed test."</span><span class="p">)</span>
<span class="k">for</span> <span class="n">post</span> <span class="ow">in</span> <span class="n">Post</span><span class="o">.</span><span class="n">query</span><span class="o">.</span><span class="n">limit</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span><span class="o">.</span><span class="n">all</span><span class="p">():</span>
<span class="n">feed</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">post</span><span class="o">.</span><span class="n">title</span><span class="p">,</span> <span class="n">post</span><span class="o">.</span><span class="n">body</span><span class="p">,</span> <span class="n">content_type</span><span class="o">=</span><span class="s1">'html'</span><span class="p">,</span>
<span class="n">author</span><span class="o">=</span><span class="n">post</span><span class="o">.</span><span class="n">author</span><span class="p">,</span> <span class="n">url</span><span class="o">=</span><span class="n">post</span><span class="o">.</span><span class="n">url</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="n">post</span><span class="o">.</span><span class="n">uid</span><span class="p">,</span>
<span class="n">updated</span><span class="o">=</span><span class="n">post</span><span class="o">.</span><span class="n">last_update</span><span class="p">,</span> <span class="n">published</span><span class="o">=</span><span class="n">post</span><span class="o">.</span><span class="n">pub_date</span><span class="p">)</span>
<span class="k">return</span> <span class="n">feed</span><span class="o">.</span><span class="n">get_response</span><span class="p">()</span>
</pre></div>
</div>
<dl class="class">
<dt id="werkzeug.contrib.atom.AtomFeed">
<em class="property">class </em><code class="descclassname">werkzeug.contrib.atom.</code><code class="descname">AtomFeed</code><span class="sig-paren">(</span><em>title=None</em>, <em>entries=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#werkzeug.contrib.atom.AtomFeed" title="Permalink to this definition">¶</a></dt>
<dd><p>A helper class that creates Atom feeds.</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>title</strong> – the title of the feed. Required.</li>
<li><strong>title_type</strong> – the type attribute for the title element. One of
<code class="docutils literal"><span class="pre">'html'</span></code>, <code class="docutils literal"><span class="pre">'text'</span></code> or <code class="docutils literal"><span class="pre">'xhtml'</span></code>.</li>
<li><strong>url</strong> – the url for the feed (not the url <em>of</em> the feed)</li>
<li><strong>id</strong> – a globally unique id for the feed. Must be an URI. If
not present the <cite>feed_url</cite> is used, but one of both is
required.</li>
<li><strong>updated</strong> – the time the feed was modified the last time. Must
be a <code class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></code> object. If not
present the latest entry’s <cite>updated</cite> is used.
Treated as UTC if naive datetime.</li>
<li><strong>feed_url</strong> – the URL to the feed. Should be the URL that was
requested.</li>
<li><strong>author</strong> – the author of the feed. Must be either a string (the
name) or a dict with name (required) and uri or
email (both optional). Can be a list of (may be
mixed, too) strings and dicts, too, if there are
multiple authors. Required if not every entry has an
author element.</li>
<li><strong>icon</strong> – an icon for the feed.</li>
<li><strong>logo</strong> – a logo for the feed.</li>
<li><strong>rights</strong> – copyright information for the feed.</li>
<li><strong>rights_type</strong> – the type attribute for the rights element. One of
<code class="docutils literal"><span class="pre">'html'</span></code>, <code class="docutils literal"><span class="pre">'text'</span></code> or <code class="docutils literal"><span class="pre">'xhtml'</span></code>. Default is
<code class="docutils literal"><span class="pre">'text'</span></code>.</li>
<li><strong>subtitle</strong> – a short description of the feed.</li>
<li><strong>subtitle_type</strong> – the type attribute for the subtitle element.
One of <code class="docutils literal"><span class="pre">'text'</span></code>, <code class="docutils literal"><span class="pre">'html'</span></code>, <code class="docutils literal"><span class="pre">'text'</span></code>
or <code class="docutils literal"><span class="pre">'xhtml'</span></code>. Default is <code class="docutils literal"><span class="pre">'text'</span></code>.</li>
<li><strong>links</strong> – additional links. Must be a list of dictionaries with
href (required) and rel, type, hreflang, title, length
(all optional)</li>
<li><strong>generator</strong> – the software that generated this feed. This must be
a tuple in the form <code class="docutils literal"><span class="pre">(name,</span> <span class="pre">url,</span> <span class="pre">version)</span></code>. If
you don’t want to specify one of them, set the item
to <cite>None</cite>.</li>
<li><strong>entries</strong> – a list with the entries for the feed. Entries can also
be added later with <a class="reference internal" href="#werkzeug.contrib.atom.AtomFeed.add" title="werkzeug.contrib.atom.AtomFeed.add"><code class="xref py py-meth docutils literal"><span class="pre">add()</span></code></a>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>For more information on the elements see
<a class="reference external" href="http://www.atomenabled.org/developers/syndication/">http://www.atomenabled.org/developers/syndication/</a></p>
<p>Everywhere where a list is demanded, any iterable can be used.</p>
<dl class="method">
<dt id="werkzeug.contrib.atom.AtomFeed.add">
<code class="descname">add</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#werkzeug.contrib.atom.AtomFeed.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a new entry to the feed. This function can either be called
with a <a class="reference internal" href="#werkzeug.contrib.atom.FeedEntry" title="werkzeug.contrib.atom.FeedEntry"><code class="xref py py-class docutils literal"><span class="pre">FeedEntry</span></code></a> or some keyword and positional arguments
that are forwarded to the <a class="reference internal" href="#werkzeug.contrib.atom.FeedEntry" title="werkzeug.contrib.atom.FeedEntry"><code class="xref py py-class docutils literal"><span class="pre">FeedEntry</span></code></a> constructor.</p>
</dd></dl>
<dl class="method">
<dt id="werkzeug.contrib.atom.AtomFeed.generate">
<code class="descname">generate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#werkzeug.contrib.atom.AtomFeed.generate" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a generator that yields pieces of XML.</p>
</dd></dl>
<dl class="method">
<dt id="werkzeug.contrib.atom.AtomFeed.get_response">
<code class="descname">get_response</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#werkzeug.contrib.atom.AtomFeed.get_response" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a response object for the feed.</p>
</dd></dl>
<dl class="method">
<dt id="werkzeug.contrib.atom.AtomFeed.to_string">
<code class="descname">to_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#werkzeug.contrib.atom.AtomFeed.to_string" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert the feed into a string.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="werkzeug.contrib.atom.FeedEntry">
<em class="property">class </em><code class="descclassname">werkzeug.contrib.atom.</code><code class="descname">FeedEntry</code><span class="sig-paren">(</span><em>title=None</em>, <em>content=None</em>, <em>feed_url=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#werkzeug.contrib.atom.FeedEntry" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a single entry in a feed.</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>title</strong> – the title of the entry. Required.</li>
<li><strong>title_type</strong> – the type attribute for the title element. One of
<code class="docutils literal"><span class="pre">'html'</span></code>, <code class="docutils literal"><span class="pre">'text'</span></code> or <code class="docutils literal"><span class="pre">'xhtml'</span></code>.</li>
<li><strong>content</strong> – the content of the entry.</li>
<li><strong>content_type</strong> – the type attribute for the content element. One
of <code class="docutils literal"><span class="pre">'html'</span></code>, <code class="docutils literal"><span class="pre">'text'</span></code> or <code class="docutils literal"><span class="pre">'xhtml'</span></code>.</li>
<li><strong>summary</strong> – a summary of the entry’s content.</li>
<li><strong>summary_type</strong> – the type attribute for the summary element. One
of <code class="docutils literal"><span class="pre">'html'</span></code>, <code class="docutils literal"><span class="pre">'text'</span></code> or <code class="docutils literal"><span class="pre">'xhtml'</span></code>.</li>
<li><strong>url</strong> – the url for the entry.</li>
<li><strong>id</strong> – a globally unique id for the entry. Must be an URI. If
not present the URL is used, but one of both is required.</li>
<li><strong>updated</strong> – the time the entry was modified the last time. Must
be a <code class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></code> object. Treated as
UTC if naive datetime. Required.</li>
<li><strong>author</strong> – the author of the entry. Must be either a string (the
name) or a dict with name (required) and uri or
email (both optional). Can be a list of (may be
mixed, too) strings and dicts, too, if there are
multiple authors. Required if the feed does not have an
author element.</li>
<li><strong>published</strong> – the time the entry was initially published. Must
be a <code class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></code> object. Treated as
UTC if naive datetime.</li>
<li><strong>rights</strong> – copyright information for the entry.</li>
<li><strong>rights_type</strong> – the type attribute for the rights element. One of
<code class="docutils literal"><span class="pre">'html'</span></code>, <code class="docutils literal"><span class="pre">'text'</span></code> or <code class="docutils literal"><span class="pre">'xhtml'</span></code>. Default is
<code class="docutils literal"><span class="pre">'text'</span></code>.</li>
<li><strong>links</strong> – additional links. Must be a list of dictionaries with
href (required) and rel, type, hreflang, title, length
(all optional)</li>
<li><strong>categories</strong> – categories for the entry. Must be a list of dictionaries
with term (required), scheme and label (all optional)</li>
<li><strong>xml_base</strong> – The xml base (url) for this feed item. If not provided
it will default to the item url.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>For more information on the elements see
<a class="reference external" href="http://www.atomenabled.org/developers/syndication/">http://www.atomenabled.org/developers/syndication/</a></p>
<p>Everywhere where a list is demanded, any iterable can be used.</p>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper"><p class="logo"><a href="../index.html">
<img class="logo" src="../_static/werkzeug.png" alt="Logo"/>
</a></p><h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li><a href="index.html">Contributed Modules</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">Contributed Modules</a></li>
<li>Next: <a href="sessions.html" title="next chapter">Sessions</a></li>
</ul></li>
</ul></li>
</ul>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/contrib/atom.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright 2011, The Werkzeug Team.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
</html>
|