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

Class FeedButton

source code

                    object --+    
                             |    
turbogears.widgets.base.Widget --+
                                 |
                                FeedButton

A text-only button for linking to a feed.

value is the link text. May use "%(type)s" placeholder for the feed format name. type is the type of the feed to link to.

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', 'title', 'type', 'url_params']
  template = '<a href="${feed_url(type)}" class="feedbutton"\n ...
  css = [CSSLink(name='css/feeds.css', media='screen', order=0)]
  base_url = '/feed'
  types = {'atom0_3': 'Atom 0.3', 'atom1_0': 'Atom 1.0', 'rdf': ...
  type = 'atom1_0'
  title = ''
  url_params = {}
  params_doc = {'base_url': 'The base_url of the feed. The feed ...
  _param_base_url = '/feed'
  _param_title = ''
  _param_type = 'atom1_0'
  _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]

template

Value:
'''<a href="${feed_url(type)}" class="feedbutton"
    py:attrs="dict(title=title % dict(type=name))" xmlns:py="http://pu\
rl.org/kid/ns#"
    ><span class="feedtype">${name}</span> <span class="feedtitle">${v\
alue % dict(type=name)}</span></a>
'''

types

Value:
{'atom0_3': 'Atom 0.3',
 'atom1_0': 'Atom 1.0',
 'rdf': 'RDF',
 'rss2_0': 'RSS 2.0'}

params_doc

Value:
{'base_url': 'The base_url of the feed. The feed format will be append\
ed to this. Can be determined from "controler", if given.',
 'title': 'String to use for "title" attribute of feed links. May use \
"%(type)s" placeholder for the feed format name.',
 'url_params': 'Dictionary containing extra URL parameters appended to\
 the feed URL'}