Grss.FeedsPool

g GObject.Object GObject.Object Grss.FeedsPool Grss.FeedsPool GObject.Object->Grss.FeedsPool

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_listened ()

get_listened_num ()

get_session ()

listen (feeds)

switch (run)

Virtual Methods

Inherited:

GObject.Object (7)

do_feed_fetching (feed)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

feed-fail

Emitted when an error raises in fetching or parsing a Grss.FeedChannel assigned to the pool.

feed-fetching

Emitted when the pool starts fetching a new Grss.FeedChannel.

feed-ready

Emitted when a Grss.FeedChannel assigned to the pool has been fetched and parsed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Grss.FeedsPool(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Grss.FeedsPoolClass

classmethod new()
Returns:

a new Grss.FeedsPool.

Return type:

Grss.FeedsPool

Allocates a new Grss.FeedsPool.

get_listened()
Returns:

a list of Grss.FeedChannel, to be freed with g_list_free() when no longer in use. Do not modify elements found in this list.

Return type:

[Grss.FeedChannel]

Returns the list of feeds currently managed by the self. Please consider this function has to build the list that returns, and of course this is a time and resources consuming task: if you only need to know how many feeds are currently handled, check Grss.FeedsPool.get_listened_num().

get_listened_num()
Returns:

number of feeds currently managed by the Grss.FeedsPool.

Return type:

int

Returns number of feeds under the self control, as provided by Grss.FeedsPool.listen(). To get the complete list of those feeds, check Grss.FeedsPool.get_listened().

get_session()
Returns:

instance of Soup.Session. Do not free it.

Return type:

Soup.Session

To access the internal Soup.Session used by the self to fetch items.

listen(feeds)
Parameters:

feeds ([Grss.FeedChannel]) – a list of Grss.FeedChannel.

To set the list of feeds to be managed by the pool. The previous list, if any, is invalidated. After invokation to the function, Grss.FeedsPool.switch() must be call to run the auto-fetching (always, also if previous state was “running”). The list in feeds can be freed after calling this; linked Grss.FeedChannel are GObject.Object.ref'd here.

switch(run)
Parameters:

run (bool) – True to run the pool, False to pause it.

Permits to pause or resume the self fetching feeds. If run is True, the self starts immediately.

do_feed_fetching(feed) virtual
Parameters:

feed (Grss.FeedChannel) –

Signal Details

Grss.FeedsPool.signals.feed_fail(feeds_pool, feed)
Signal Name:

feed-fail

Flags:

RUN_LAST

Parameters:

Emitted when an error raises in fetching or parsing a Grss.FeedChannel assigned to the pool.

Grss.FeedsPool.signals.feed_fetching(feeds_pool, feed)
Signal Name:

feed-fetching

Flags:

RUN_LAST

Parameters:

Emitted when the pool starts fetching a new Grss.FeedChannel. To be used to know the internal status of the component.

Grss.FeedsPool.signals.feed_ready(feeds_pool, feed, items)
Signal Name:

feed-ready

Flags:

RUN_LAST

Parameters:

Emitted when a Grss.FeedChannel assigned to the pool has been fetched and parsed. All parsed items are exposed in the array, with no regards about previously existing elements. items may be None, if an error occurred while fetching and/or parsing. List of items is freed, and his elements are unref’d, when signal ends.