Sugar.presence.activity: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Sugar Activity}}
{{Sugar Almanac}}
= Class: Activity([http://www.pygtk.org/docs/pygobject/class-gobject.html gobject.GObject]) =
= Class: PresenceService (gobject.GObject) =


=== What are some of the properties of a shared activity that I can extract using a reference to the presence Activity object? ===
=== What are some of the properties of a shared activity that I can extract using a reference to the presence Activity object? ===

Latest revision as of 03:22, 2 October 2008

  Sugar Almanac

Class: PresenceService (gobject.GObject)

What are some of the properties of a shared activity that I can extract using a reference to the presence Activity object?

The Activity class in presence has several GObject properties that can be accessed using the get_property() method on the activity object. The code below shows how some of these properties are accessed and printed.

    #### Method: _print_activity_props, which prints some basic activity properties
    # made available in sugar.presence.activity.Activity
    def _print_activity_props(self, activity):
        print activity.get_property('id') 
        print activity.get_property('name') #e.g. 'Turtle Activity'
        print activity.get_property('tags')
        print activity.get_property('color') 
        print activity.get_property('type') #e.g. 'org.laptop.TurtleArtActivity'
        print activity.get_property('private') #True or false value about whether this activity is private
        print activity.get_property('joined')