sugar.presence package
Submodules
sugar.presence.activity module
UI interface to an activity in the presence service
STABLE.
- class sugar.presence.activity.Activity(*args: Any, **kwargs: Any)[source]
Bases:
GObject
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
- get_joined_buddies()[source]
Retrieve the set of Buddy objects attached to this activity
returns list of presence Buddy objects that we can successfully create from the buddy object paths that PS has for this activity.
- get_buddy_by_handle(handle)[source]
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(buddy, message, response_cb)[source]
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()[source]
Join this activity.
Emits ‘joined’ and otherwise does nothing if we’re already joined.
- get_channels()[source]
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
sugar.presence.buddy module
UI interface to a buddy in the presence service
STABLE.
- class sugar.presence.buddy.BaseBuddy(*args: Any, **kwargs: Any)[source]
Bases:
GObject
UI interface for a Buddy in the presence service
Each buddy interface tracks a set of activities and properties that can be queried to provide UI controls for manipulating the presence interface.
- Properties Dictionary:
‘key’: public key, ‘nick’: nickname , ‘color’: color (XXX what format), ‘current-activity’: (XXX dbus path?), ‘owner’: (XXX dbus path?),
sugar.presence.connectionmanager module
UNSTABLE. It should really be internal to the sugar.presence package.
sugar.presence.presenceservice module
STABLE.
- class sugar.presence.presenceservice.PresenceService(*args: Any, **kwargs: Any)[source]
Bases:
GObject
Provides simplified access to the Telepathy framework to activities
- get_activity(activity_id, warn_if_none=True)[source]
Retrieve single Activity object for the given unique id
activity_id – unique ID for the activity
- returns single Activity object or None if the activity
is not found using GetActivityById on the service
- get_buddy_by_telepathy_handle(tp_conn_name, tp_conn_path, handle)[source]
Retrieve single Buddy object for the given public key
- Parameters:
- tp_conn_namestr
The well-known bus name of a Telepathy connection
- tp_conn_pathdbus.ObjectPath
The object path of the Telepathy connection
- handleint or long
The handle of a Telepathy contact on that connection, of type HANDLE_TYPE_CONTACT. This may not be a channel-specific handle.
- Returns:
the Buddy object, or None if the buddy is not found
sugar.presence.sugartubeconn module
Subclass of TubeConnection that converts handles to Sugar Buddies
STABLE.
- class sugar.presence.sugartubeconn.SugarTubeConnection(conn, tubes_iface, tube_id, address=None, group_iface=None, mainloop=None)[source]
Bases:
TubeConnection
Subclass of TubeConnection that converts handles to Sugar Buddies
sugar.presence.tubeconn module
STABLE.
Module contents
Client-code’s interface to the PresenceService
Provides a simplified API for accessing the dbus service which coordinates native network presence and sharing information. This includes both “buddies” and “shared activities”.