Package turbofeeds :: Module widgets :: Class FeedLinks
[hide private]

Class FeedLinks

source code

                    object --+    
                             |    
turbogears.widgets.base.Widget --+
                                 |
                                FeedLinks
Known Subclasses:

A list of links to feeds for all supported formats.

The value passed to the widget contructor or display method will be the text for the link. The value may use the "%(type)s" placeholder for the feed format name.

Nested Classes [hide private]
  template_c

Inherited from turbogears.widgets.base.Widget: __metaclass__

Instance Methods [hide private]
 
update_params(self, params)
Sets feed URL to callable that generates URL for each format.
source code
 
feed_url(self, base_url, type, params)
Returns feed URL by combining base_url, feed type and params.
source code

Inherited from turbogears.widgets.base.Widget: __call__, __init__, __repr__, __setattr__, adjust_value, display, render, retrieve_css, retrieve_javascript

Inherited from turbogears.widgets.base.Widget (private): _get_is_named

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __str__

Class Variables [hide private]
  params = ['base_url', 'controller', 'feed_types', 'mimetypes',...
  template = '<div xmlns:py="http://purl.org/kid/ns#" py:strip="...
  css = [CSSLink(name='css/feeds.css', media='screen', order=0)]
  base_url = <turbogears.widgets.meta.ParamDescriptor object at ...
  controller = <turbogears.widgets.meta.ParamDescriptor object a...
  feed_types = [('rss2_0', 'RSS 2.0'), ('atom0_3', 'Atom 0.3'), ...
  title = '%(type)s'
  url_params = {}
  mimetypes = {'atom0_3': 'application/atom+xml', 'atom1_0': 'ap...
  params_doc = {'base_url': 'The base_url of the feed. The feed ...
  _param_base_url = None
  _param_controller = None
  _param_feed_types = [('rss2_0', 'RSS 2.0'), ('atom0_3', 'Atom ...
  _param_mimetypes = {'atom0_3': 'application/atom+xml', 'atom1_...
  _param_title = '%(type)s'
  _param_url_params = {}

Inherited from turbogears.widgets.base.Widget: default, javascript, name

Inherited from turbogears.widgets.base.Widget (private): _locked

Properties [hide private]

Inherited from turbogears.widgets.base.Widget: is_named

Inherited from object: __class__

Method Details [hide private]

update_params(self, params)

source code 
Sets feed URL to callable that generates URL for each format.
Overrides: turbogears.widgets.base.Widget.update_params

Class Variable Details [hide private]

params

Value:
['base_url',
 'controller',
 'feed_types',
 'mimetypes',
 'title',
 'url_params']

template

Value:
'''<div xmlns:py="http://purl.org/kid/ns#" py:strip="">
  <ul class="feedlinklist">
    <li py:for="type, name in feed_types">
      <a py:attrs="dict(title=title % dict(type=name))" class="feedlin\
k"
        href="${feed_url(type)}">${value % dict(type=name)}</a>
    </li>
  </ul>
...

base_url

Value:
<turbogears.widgets.meta.ParamDescriptor object at 0x26b0250>

controller

Value:
<turbogears.widgets.meta.ParamDescriptor object at 0x26b07d0>

feed_types

Value:
[('rss2_0', 'RSS 2.0'), ('atom0_3', 'Atom 0.3'), ('atom1_0', 'Atom 1.0\
')]

mimetypes

Value:
{'atom0_3': 'application/atom+xml', 'atom1_0': 'application/rss+xml', \
'mrss1_1_1': 'application/rss+xml', 'rss2_0': 'application/rss+xml',}

params_doc

Value:
{'base_url': 'The base_url of the feed. The feed format will be append\
ed to this. Can be determined from "controller", if given.',
 'controller': 'The FeedController instance serving the feeds the link\
s will point to.',
 'feed_types': 'A list of 2-item tuples matching format identifier to \
format name. A link will be generated for each format.',
 'title': 'String to use for "title" attribute of feed links. May use \
"%(type)s" placeholder for the feed format name.',
...

_param_feed_types

Value:
[('rss2_0', 'RSS 2.0'),
 ('atom0_3', 'Atom 0.3'),
 ('atom1_0', 'Atom 1.0')]

_param_mimetypes

Value:
{'atom0_3': 'application/atom+xml',
 'atom1_0': 'application/rss+xml',
 'mrss1_1_1': 'application/rss+xml',
 'rss2_0': 'application/rss+xml'}