The eventfeed module

This module encapsulates the features and communcation with the Event Feed Service.

EventFeedService

Your application should instantiate exactly one instance of this class, and it should ideally be alive throughout the lifetime of your application, so that you can receive events from the items when they are clicked.

class eventfeed.EventFeedService(source_name, source_display_name, on_data_received=None)
add_item(item)

Send a EventFeedItem to the service to be displayed

Parameters:
  • item – EventFeedItem to be displayed
remove_items()

Remove all items

update_item(item)

Update a previously-sent EventFeedItem

Parameters:
  • item – EventFeedItem to be updated

EventFeedItem

For each event that you want to display, you need to create one instance of this class and then use the event feed service to display the object.

class eventfeed.EventFeedItem(icon, title, timestamp=None)

One item that can be posted to the event feed

set_action_data(*args)

The data to be sent when clicked (list of str, int, bool)

set_body(body)

Body text of the item (string)

set_custom_action(callback)

The action to be executed when clicked (callable)

Footer text, displayed near the time (string)

set_image_list(image_list)

List of image filenames/URLs (list of strings)

set_url(url)

The URL to be opened when the item is clicked (string)

set_video(video)

Flag to overlay a play button on the thumbnail (bool)

Table Of Contents

Previous topic

Event Feed Library for Harmattan

This Page