diff --git a/shell/ChatController.py b/shell/ChatController.py index 0b4068d2..b1b39d33 100644 --- a/shell/ChatController.py +++ b/shell/ChatController.py @@ -1,4 +1,4 @@ -from sugar import env +from sugar import conf from sugar.chat.BuddyChat import BuddyChat from sugar.activity import ActivityFactory from sugar.presence import PresenceService @@ -24,7 +24,8 @@ class ChatController: self._pservice = PresenceService.get_instance() self._pservice.register_service_type(BuddyChat.SERVICE_TYPE) - self._service = self._pservice.register_service(env.get_nick_name(), + profile = conf.get_profile() + self._service = self._pservice.register_service(profile.get_nick_name(), BuddyChat.SERVICE_TYPE) self._buddy_stream = Stream.new_from_service(self._service) diff --git a/shell/Owner.py b/shell/Owner.py index e2e64e8c..fe9682a8 100644 --- a/shell/Owner.py +++ b/shell/Owner.py @@ -14,8 +14,10 @@ class ShellOwner(object): runs in the shell and serves up the buddy icon and other stuff. It's the server portion of the Owner, paired with the client portion in Buddy.py.""" def __init__(self): - self._nick = env.get_nick_name() - user_dir = env.get_profile_path() + profile = conf.get_profile() + + self._nick = profile.get_nick_name() + user_dir = profile.get_path() self._icon = None for fname in os.listdir(user_dir): diff --git a/shell/PresenceService/PresenceService.py b/shell/PresenceService/PresenceService.py index fe97698f..f40d6e72 100644 --- a/shell/PresenceService/PresenceService.py +++ b/shell/PresenceService/PresenceService.py @@ -6,7 +6,7 @@ import random import logging from sugar import env from sugar import util - +from sugar import conf def _get_local_ip_address(ifname): """Call Linux specific bits to retrieve our own IP address.""" @@ -370,7 +370,7 @@ class PresenceService(object): self._dbus_helper.ServiceAppeared(service.object_path()) except KeyError: # Should this service mark the owner? - owner_nick = env.get_nick_name() + owner_nick = conf.get_profile().get_nick_name() source_addr = service.get_source_address() objid = self._get_next_object_id() if name == owner_nick and source_addr in self._local_addrs.values(): diff --git a/shell/Shell.py b/shell/Shell.py index b79e2457..59cfc599 100755 --- a/shell/Shell.py +++ b/shell/Shell.py @@ -75,7 +75,8 @@ class Shell(gobject.GObject): self._screen.connect("showing_desktop_changed", self.__showing_desktop_changed_cb) - if env.get_nick_name() == None: + profile = conf.get_profile() + if profile.get_nick_name() == None: dialog = FirstTimeDialog() dialog.connect('destroy', self.__first_time_dialog_destroy_cb) dialog.set_transient_for(self._home_window) diff --git a/sugar/env.py b/sugar/env.py index 6f654f36..992bcf3d 100644 --- a/sugar/env.py +++ b/sugar/env.py @@ -60,10 +60,6 @@ def get_profile_path(): return os.path.join(path, profile_id) -def get_nick_name(): - profile = sugar.conf.get_profile() - return profile.get_nick_name() - def get_data_dir(): return sugar_data_dir