Grss.FeedFormatter

g GObject.Object GObject.Object Grss.FeedFormatter Grss.FeedFormatter GObject.Object->Grss.FeedFormatter

Subclasses:

Grss.FeedAtomFormatter, Grss.FeedRssFormatter

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

add_item (item)

add_items (items)

format ()

get_channel ()

get_items ()

reset ()

set_channel (channel)

Virtual Methods

Inherited:

GObject.Object (7)

do_format ()

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Grss.FeedFormatter(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Grss.FeedFormatterClass

add_item(item)
Parameters:

item (Grss.FeedItem) – a Grss.FeedItem to add into the self.

Adds a single Grss.FeedItem in the self.

add_items(items)
Parameters:

items ([Grss.FeedItem]) – a list of Grss.FeedItems to add into the self.

Adds a list of Grss.FeedItems in the self.

format()
Returns:

a string containing the plain text rappresentation of the given channel containing the given items.

Return type:

str

Formats the assigned Grss.FeedChannel and Grss.FeedItems into a plain text string, accordly to the current Grss.FeedFormatter instance.

get_channel()
Returns:

a Grss.FeedChannel, or None if none has been assigned.

Return type:

Grss.FeedChannel

Gets the current Grss.FeedChannel assigned to the self.

get_items()
Returns:

a list of Grss.FeedItems, or None if none has been assigned.

Return type:

[Grss.FeedItem]

Gets the current Grss.FeedItems assigned to the self.

reset()

Resets the status of the Grss.FeedFormatter, cleaning up the assigned Grss.FeedChannel and related Grss.FeedItems. This way self is ready to be used again with new data.

set_channel(channel)
Parameters:

channel (Grss.FeedChannel) – the reference Grss.FeedChannel for the self.

Inits the Grss.FeedFormatter with the given channel. A Grss.FeedFormatter can format a single Grss.FeedChannel each time, but may be reused by calling Grss.FeedFormatter.reset()

do_format() virtual
Returns:

a string containing the plain text rappresentation of the given channel containing the given items.

Return type:

str

Formats the assigned Grss.FeedChannel and Grss.FeedItems into a plain text string, accordly to the current Grss.FeedFormatter instance.