Grss.FeedsPublisher¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Grss.FeedsPublisher(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
Grss.FeedsPublisher
.- Return type:
Allocates a new
Grss.FeedsPublisher
.
- format_content(channel, items)¶
- Parameters:
channel (
Grss.FeedChannel
) – theGrss.FeedChannel
to dump in the file.items ([
Grss.FeedItem
]) – list ofGrss.FeedItems
to be added in the feed.
- Raises:
- Returns:
a newly allocated string holding the formatted feed, to be freed when no longer in use.
- Return type:
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 ofGrss.FeedChannels
.
To define a list of valid “topics” for which the
Grss.FeedsPublisher
will deliver contents. Sources of those channels, as retrieved byGrss.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)¶
-
Permits to start and stop the webserver implemented by this object.
- publish_file(channel, items, uri)¶
- Parameters:
channel (
Grss.FeedChannel
) – theGrss.FeedChannel
to dump in the file.items ([
Grss.FeedItem
]) – list ofGrss.FeedItems
to be added in the feed.uri (
str
) – URI of the file to write. The full path must exists.
- Raises:
- Returns:
- Return type:
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 sameGrss.FeedChannel
.
- publish_web(channel, items, id)¶
- Parameters:
channel (
Grss.FeedChannel
) – theGrss.FeedChannel
to dump in the file.items ([
Grss.FeedItem
]) – list ofGrss.FeedItems
to be added in the feed.id (
str
) – name used in the external URL of the feed.
- Raises:
- Returns:
- Return type:
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:
topic (
Grss.FeedChannel
) –callback (
str
) –
- do_new_subscription(topic, callback) virtual¶
- Parameters:
topic (
Grss.FeedChannel
) –callback (
str
) –
Signal Details¶
- Grss.FeedsPublisher.signals.delete_subscription(feeds_publisher, object, p0)¶
- Signal Name:
delete-subscription
- Flags:
- Parameters:
feeds_publisher (
Grss.FeedsPublisher
) – The object which received the signalobject (
Grss.FeedChannel
) –p0 (
str
) –
- Grss.FeedsPublisher.signals.new_subscription(feeds_publisher, object, p0)¶
- Signal Name:
new-subscription
- Flags:
- Parameters:
feeds_publisher (
Grss.FeedsPublisher
) – The object which received the signalobject (
Grss.FeedChannel
) –p0 (
str
) –