Grss.FeedsPublisher

g GObject.Object GObject.Object Grss.FeedsPublisher Grss.FeedsPublisher GObject.Object->Grss.FeedsPublisher

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

format_content (channel, items)

hub_set_port (port)

hub_set_topics (topics)

hub_switch (run)

publish_file (channel, items, uri)

publish_web (channel, items, id)

Virtual Methods

Inherited:

GObject.Object (7)

do_delete_subscription (topic, callback)

do_new_subscription (topic, callback)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

delete-subscription

new-subscription

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Grss.FeedsPublisher(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Grss.FeedsPublisherClass

classmethod new()
Returns:

a new Grss.FeedsPublisher.

Return type:

Grss.FeedsPublisher

Allocates a new Grss.FeedsPublisher.

format_content(channel, items)
Parameters:
Raises:

GLib.Error

Returns:

a newly allocated string holding the formatted feed, to be freed when no longer in use.

Return type:

str

Format a Grss.FeedChannel in Atom and returns the resulting string.

Deprecated since version 0.6: Use Grss.FeedFormatter.format() instead.

hub_set_port(port)
Parameters:

port (int) – new listening port for the server.

To customize the port opened by the local server to deliver feeds and catch incoming subscriptions. By default this is 80. Changing the port while the hub is running imply restart the local server.

hub_set_topics(topics)
Parameters:

topics ([Grss.FeedChannel]) – a list of Grss.FeedChannels.

To define a list of valid “topics” for which the Grss.FeedsPublisher will deliver contents. Sources of those channels, as retrieved by Grss.FeedChannel.get_source(), are accepted as “hub.topic” parameter in PubSubHubbub registration requests from remote subscribers. Pay attention to the fact subscriptions requests for different topic are now rejected.

hub_switch(run)
Parameters:

run (bool) – True to run the local server, False to stop it.

Permits to start and stop the webserver implemented by this object.

publish_file(channel, items, uri)
Parameters:
Raises:

GLib.Error

Returns:

True if the file is successfully written, False otherwise.

Return type:

bool

Dump the given channel in an Atom formatted file in path. If the local PubSubHubbub hub has been activated (with Grss.FeedsPublisher.hub_switch()) notifies remote subscribers about the new items which has been added since previous invocation of this function for the same Grss.FeedChannel.

publish_web(channel, items, id)
Parameters:
Raises:

GLib.Error

Returns:

True if the file is successfully written, False otherwise.

Return type:

bool

If the local web server has been executed (with Grss.FeedsPublisher.hub_switch()) this function exposes the given channel as an Atom formatted file avalable to http://[LOCAL_IP:DEFINED_PORT]/id .

do_delete_subscription(topic, callback) virtual
Parameters:
do_new_subscription(topic, callback) virtual
Parameters:

Signal Details

Grss.FeedsPublisher.signals.delete_subscription(feeds_publisher, object, p0)
Signal Name:

delete-subscription

Flags:

RUN_LAST

Parameters:
Grss.FeedsPublisher.signals.new_subscription(feeds_publisher, object, p0)
Signal Name:

new-subscription

Flags:

RUN_LAST

Parameters: