Get rid of env.get_nick_name, that comes from the profile now
This commit is contained in:
parent
4f3e3a290c
commit
a7c552c038
@ -1,4 +1,4 @@
|
|||||||
from sugar import env
|
from sugar import conf
|
||||||
from sugar.chat.BuddyChat import BuddyChat
|
from sugar.chat.BuddyChat import BuddyChat
|
||||||
from sugar.activity import ActivityFactory
|
from sugar.activity import ActivityFactory
|
||||||
from sugar.presence import PresenceService
|
from sugar.presence import PresenceService
|
||||||
@ -24,7 +24,8 @@ class ChatController:
|
|||||||
self._pservice = PresenceService.get_instance()
|
self._pservice = PresenceService.get_instance()
|
||||||
|
|
||||||
self._pservice.register_service_type(BuddyChat.SERVICE_TYPE)
|
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)
|
BuddyChat.SERVICE_TYPE)
|
||||||
|
|
||||||
self._buddy_stream = Stream.new_from_service(self._service)
|
self._buddy_stream = Stream.new_from_service(self._service)
|
||||||
|
@ -14,8 +14,10 @@ class ShellOwner(object):
|
|||||||
runs in the shell and serves up the buddy icon and other stuff. It's the
|
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."""
|
server portion of the Owner, paired with the client portion in Buddy.py."""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._nick = env.get_nick_name()
|
profile = conf.get_profile()
|
||||||
user_dir = env.get_profile_path()
|
|
||||||
|
self._nick = profile.get_nick_name()
|
||||||
|
user_dir = profile.get_path()
|
||||||
|
|
||||||
self._icon = None
|
self._icon = None
|
||||||
for fname in os.listdir(user_dir):
|
for fname in os.listdir(user_dir):
|
||||||
|
@ -6,7 +6,7 @@ import random
|
|||||||
import logging
|
import logging
|
||||||
from sugar import env
|
from sugar import env
|
||||||
from sugar import util
|
from sugar import util
|
||||||
|
from sugar import conf
|
||||||
|
|
||||||
def _get_local_ip_address(ifname):
|
def _get_local_ip_address(ifname):
|
||||||
"""Call Linux specific bits to retrieve our own IP address."""
|
"""Call Linux specific bits to retrieve our own IP address."""
|
||||||
@ -370,7 +370,7 @@ class PresenceService(object):
|
|||||||
self._dbus_helper.ServiceAppeared(service.object_path())
|
self._dbus_helper.ServiceAppeared(service.object_path())
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# Should this service mark the owner?
|
# 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()
|
source_addr = service.get_source_address()
|
||||||
objid = self._get_next_object_id()
|
objid = self._get_next_object_id()
|
||||||
if name == owner_nick and source_addr in self._local_addrs.values():
|
if name == owner_nick and source_addr in self._local_addrs.values():
|
||||||
|
@ -75,7 +75,8 @@ class Shell(gobject.GObject):
|
|||||||
self._screen.connect("showing_desktop_changed",
|
self._screen.connect("showing_desktop_changed",
|
||||||
self.__showing_desktop_changed_cb)
|
self.__showing_desktop_changed_cb)
|
||||||
|
|
||||||
if env.get_nick_name() == None:
|
profile = conf.get_profile()
|
||||||
|
if profile.get_nick_name() == None:
|
||||||
dialog = FirstTimeDialog()
|
dialog = FirstTimeDialog()
|
||||||
dialog.connect('destroy', self.__first_time_dialog_destroy_cb)
|
dialog.connect('destroy', self.__first_time_dialog_destroy_cb)
|
||||||
dialog.set_transient_for(self._home_window)
|
dialog.set_transient_for(self._home_window)
|
||||||
|
@ -60,10 +60,6 @@ def get_profile_path():
|
|||||||
|
|
||||||
return os.path.join(path, profile_id)
|
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():
|
def get_data_dir():
|
||||||
return sugar_data_dir
|
return sugar_data_dir
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user