akvo.rsr.feeds module

class akvo.rsr.feeds.AllProjectUpdates[source]

Bases: UpdateFeed

RSS feed for last 25 RSR updates.

description = 'Project updates for all Akvo RSR projects'
item_title(item)[source]
items()[source]
title = 'Last 25 RSR project updates'
class akvo.rsr.feeds.OrganisationUpdates[source]

Bases: UpdateFeed

RSS feed for last 25 RSR updates of an organisation.

description(obj)[source]
feed_type

alias of RSRMediaRssFeed

get_object(request, org_id)[source]
item_title(item)[source]
items(obj)[source]
title(obj)[source]
class akvo.rsr.feeds.ProjectUpdates[source]

Bases: UpdateFeed

RSS feed for last 25 RSR updates of a project.

description(obj)[source]
get_object(request, project_id)[source]
items(obj)[source]
title(obj)[source]
class akvo.rsr.feeds.RSRMediaRssFeed(title, link, description, language=None, author_email=None, author_name=None, author_link=None, subtitle=None, categories=None, feed_url=None, feed_copyright=None, feed_guid=None, ttl=None, **kwargs)[source]

Bases: Rss201rev2Feed

add_item_elements(handler, item)[source]

Callback to add elements to each item (item/entry) element.

rss_attributes()[source]
write(outfile, encoding)[source]

Output the feed in the given encoding to outfile, which is a file-like object. Subclasses should override this.

class akvo.rsr.feeds.RSRSimplerXMLGenerator(out=None, encoding='iso-8859-1', short_empty_elements=False)[source]

Bases: XMLGenerator

subclassed to be able to call custom escape() function, see above

addQuickElement(name, contents=None, attrs=None)[source]

Convenience method for adding an element with no children

characters(content)[source]

Receive notification of character data.

The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.

class akvo.rsr.feeds.UpdateFeed[source]

Bases: Feed

base class generating Update feeds

feed_type

alias of RSRMediaRssFeed

item_author_name(item)[source]
item_credit(item)[source]
item_description(item)[source]
item_extra_kwargs(item)[source]

return a dictionary to the feedgenerator for each item to be added to the feed.

item_pubdate(item)[source]
item_title(item)[source]
akvo.rsr.feeds.escape(data, entities={})[source]

Modification to xml.sax.saxutils.escape to that detects CDATA blocks that are not escaped

Escape &, <, and > in a string of data.

You can escape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value.