diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-04 19:34:54 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-04 19:34:54 (GMT) |
commit | 01c4658ee0e5f36a966d03375de1afb14605d9e3 (patch) | |
tree | bc3c13ed85cc8b8fa5886f23507185f11e5c397d /sugar/activity | |
parent | 995c74b11640941d985bd756320068cb0a7d05a1 (diff) |
Make conf private, expose the nick name from env
Diffstat (limited to 'sugar/activity')
-rw-r--r-- | sugar/activity/Activity.py | 5 | ||||
-rw-r--r-- | sugar/activity/__init__.py | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/sugar/activity/Activity.py b/sugar/activity/Activity.py index f1bbf23..0b0600f 100644 --- a/sugar/activity/Activity.py +++ b/sugar/activity/Activity.py @@ -7,7 +7,7 @@ import gtk import gobject from sugar.presence.PresenceService import PresenceService -from sugar.conf import ActivityRegistry +from sugar import activity import sugar.util ACTIVITY_SERVICE_NAME = "org.laptop.Activity" @@ -20,7 +20,6 @@ def get_service_name(xid): def get_object_path(xid): return ACTIVITY_SERVICE_PATH + "/%s" % xid - class ActivityDbusService(dbus.service.Object): """Base dbus service object that each Activity uses to export dbus methods. @@ -91,7 +90,7 @@ class Activity(gtk.Window): def set_type(self, activity_type): """Sets the activity type.""" self._activity_type = activity_type - self._default_type = ActivityRegistry.get_default_type(activity_type) + self._default_type = activity.get_default_type(activity_type) def get_type(self): """Gets the activity type.""" diff --git a/sugar/activity/__init__.py b/sugar/activity/__init__.py index e69de29..94a1a08 100644 --- a/sugar/activity/__init__.py +++ b/sugar/activity/__init__.py @@ -0,0 +1,8 @@ +def get_default_type(activity_type): + """Get the activity default type. + + It's the type of the main network service which tracks presence + and provides info about the activity, for example the title.""" + splitted_id = activity_type.split('.') + splitted_id.reverse() + return '_' + '_'.join(splitted_id) + '._udp' |