Refactor startup. In progress, give me a couple hours.

For now start sugar with "sugar-emulator shell/sugar-shell"
This commit is contained in:
Marco Pesenti Gritti
2006-10-16 13:34:43 +02:00
parent a3be4492b2
commit bc0ee6d34c
22 changed files with 108 additions and 428 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ import logging
import gobject
import dbus, dbus.service
from sugar import env
from sugar import profile
PRESENCE_SERVICE_TYPE = "_presence_olpc._tcp"
@@ -416,8 +416,8 @@ class Owner(Buddy):
portion of the Owner, paired with the server portion in Owner.py."""
def __init__(self, ps, bus_name, object_id, icon_cache):
Buddy.__init__(self, bus_name, object_id, None, icon_cache)
self._nick_name = env.get_nick_name()
self._color = env.get_color()
self._nick_name = profile.get_nick_name()
self._color = profile.get_color()
self._ps = ps
def add_service(self, service):
+3 -3
View File
@@ -22,6 +22,7 @@ import random
import logging
from sugar import util
from sugar import env
from sugar import profile
import BuddyIconCache
@@ -293,6 +294,7 @@ class PresenceServiceDBusHelper(dbus.service.Object):
class PresenceService(object):
def __init__(self):
# interface -> IP address: interfaces we've gotten events on so far
self._started = False
self._local_addrs = {}
self._next_object_id = 0
@@ -319,7 +321,7 @@ class PresenceService(object):
self._icon_cache = BuddyIconCache.BuddyIconCache()
# Our owner object
if env.get_nick_name():
if profile.get_nick_name():
objid = self._get_next_object_id()
self._owner = Buddy.Owner(self, self._bus_name,
objid, self._icon_cache)
@@ -327,8 +329,6 @@ class PresenceService(object):
else:
self._owner = None
self._started = False
def start(self):
if self._started:
return