Package sugar :: Package presence :: Module activity :: Class Activity
[hide private]
[frames] | no frames]

Class Activity

source code

     object --+    
              |    
gobject.GObject --+
                  |
                 Activity

UI interface for an Activity in the presence service

Activities in the presence service represent your and other user's shared activities.

Properties:
id color name type joined


Instance Methods [hide private]
 
__init__(self, bus, new_obj_cb, del_obj_cb, object_path)
Initialse the activity interface, connecting to service
source code
 
__repr__(self)
repr(x)
source code
 
_get_properties_reply_cb(self, new_props) source code
 
_get_properties_error_cb(self, e) source code
 
_properties_changed_cb(self, new_props) source code
 
object_path(self)
Get our dbus object path
source code
 
do_get_property(self, pspec)
Retrieve a particular property from our property dictionary
source code
 
do_set_property(self, pspec, val)
Set a particular property in our property dictionary
source code
 
set_private(self, val, reply_handler, error_handler) source code
 
_emit_buddy_joined_signal(self, object_path)
Generate buddy-joined GObject signal with presence Buddy object
source code
 
_buddy_handle_joined_cb(self, object_path, handle) source code
 
_emit_buddy_left_signal(self, object_path)
Generate buddy-left GObject signal with presence Buddy object
source code
 
_buddy_left_cb(self, object_path) source code
 
_emit_new_channel_signal(self, object_path)
Generate new-channel GObject signal with channel object path
source code
 
_new_channel_cb(self, object_path) source code
 
get_joined_buddies(self)
Retrieve the set of Buddy objects attached to this activity
source code
 
get_buddy_by_handle(self, handle)
Retrieve the Buddy object given a telepathy handle.
source code
 
invite(self, buddy, message, response_cb)
Invite the given buddy to join this activity.
source code
 
set_up_tubes(self, reply_handler, error_handler) source code
 
_join_cb(self) source code
 
_join_error_cb(self, err) source code
 
join(self)
Join this activity.
source code
 
get_channels(self)
Retrieve communications channel descriptions for the activity
source code
 
_leave_cb(self)
Callback for async action of leaving shared activity.
source code
 
_leave_error_cb(self, err)
Callback for error in async leaving of shared activity.
source code
 
leave(self)
Leave this shared activity
source code

Inherited from gobject.GObject: __cmp__, __delattr__, __gdoc__, __gobject_init__, __hash__, __new__, __setattr__, chain, connect, connect_after, connect_object, connect_object_after, disconnect, disconnect_by_func, emit, emit_stop_by_name, freeze_notify, get_data, get_properties, get_property, handler_block, handler_block_by_func, handler_disconnect, handler_is_connected, handler_unblock, handler_unblock_by_func, notify, props, set_data, set_properties, set_property, stop_emission, thaw_notify, weak_ref

Inherited from object: __getattribute__, __reduce__, __reduce_ex__, __str__

Class Variables [hide private]
  __gsignals__ = {'buddy-joined':(gobject.SIGNAL_RUN_FIRST, gobj...
  __gproperties__ = {'id':(str, None, None, None, gobject.PARAM_...
  _PRESENCE_SERVICE = 'org.laptop.Sugar.Presence'
  _ACTIVITY_DBUS_INTERFACE = 'org.laptop.Sugar.Presence.Activity'
  __gtype__ = <GType sugar+presence+activity+Activity (150687176)>
Properties [hide private]

Inherited from gobject.GObject: __grefcount__

Inherited from object: __class__

Method Details [hide private]

__init__(self, bus, new_obj_cb, del_obj_cb, object_path)
(Constructor)

source code 
Initialse the activity interface, connecting to service
Overrides: gobject.GObject.__init__

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: gobject.GObject.__repr__
(inherited documentation)

_emit_buddy_left_signal(self, object_path)

source code 

Generate buddy-left GObject signal with presence Buddy object

XXX note use of _ps_new_object instead of _ps_del_object here

_emit_new_channel_signal(self, object_path)

source code 

Generate new-channel GObject signal with channel object path

New telepathy-python communications channel has been opened

get_joined_buddies(self)

source code 

Retrieve the set of Buddy objects attached to this activity

returns list of presence Buddy objects

get_buddy_by_handle(self, handle)

source code 

Retrieve the Buddy object given a telepathy handle.

buddy object paths are cached in self._handle_to_buddy_path, so we can get the buddy without calling PS.

invite(self, buddy, message, response_cb)

source code 

Invite the given buddy to join this activity.

The callback will be called with one parameter: None on success, or an exception on failure.

join(self)

source code 

Join this activity.

Emits 'joined' and otherwise does nothing if we're already joined.

get_channels(self)

source code 

Retrieve communications channel descriptions for the activity

Returns a tuple containing:
  • the D-Bus well-known service name of the connection (FIXME: this is redundant; in Telepathy it can be derived from that of the connection)
  • the D-Bus object path of the connection
  • a list of D-Bus object paths representing the channels associated with this activity

Class Variable Details [hide private]

__gsignals__

Value:
{'buddy-joined':(gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([gobjec\
t.TYPE_PYOBJECT])), 'buddy-left':(gobject.SIGNAL_RUN_FIRST, gobject.TY\
PE_NONE, ([gobject.TYPE_PYOBJECT])), 'new-channel':(gobject.SIGNAL_RUN\
_FIRST, gobject.TYPE_NONE, ([gobject.TYPE_PYOBJECT])), 'joined':(gobje\
ct.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([gobject.TYPE_PYOBJECT, gobje\
ct.TYPE_PYOBJECT])),}

__gproperties__

Value:
{'id':(str, None, None, None, gobject.PARAM_READABLE), 'name':(str, No\
ne, None, None, gobject.PARAM_READWRITE), 'tags':(str, None, None, Non\
e, gobject.PARAM_READWRITE), 'color':(str, None, None, None, gobject.P\
ARAM_READWRITE), 'type':(str, None, None, None, gobject.PARAM_READABLE\
), 'private':(bool, None, None, True, gobject.PARAM_READWRITE), 'joine\
d':(bool, None, None, False, gobject.PARAM_READABLE),}