Get rid of env.get_nick_name, that comes from the profile now

This commit is contained in:
Marco Pesenti Gritti 2006-08-26 13:03:06 +02:00
parent 4f3e3a290c
commit a7c552c038
5 changed files with 11 additions and 11 deletions

View File

@ -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)

View File

@ -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):

View File

@ -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():

View File

@ -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)

View File

@ -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