From bfab84acc9cfea367ac08086eb4de0d753d91653 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 24 Jul 2006 16:27:52 +0000 Subject: Poll for PS readiness rather than a hard wait time --- diff --git a/shell/Session.py b/shell/Session.py index cdea610..efb2c22 100644 --- a/shell/Session.py +++ b/shell/Session.py @@ -2,6 +2,9 @@ import os import gtk import gobject import time +import dbus +import dbus.dbus_bindings +from sugar.presence import PresenceService from Shell import Shell from Process import Process @@ -47,15 +50,19 @@ class MatchboxProcess(Process): class PresenceServiceProcess(Process): def __init__(self): - Process.__init__(self, "sugar-presence-service",) + Process.__init__(self, "sugar-presence-service") def get_name(self): return "PresenceService" def start(self): Process.start(self) - # FIXME we really need something better - time.sleep(3) + bus = dbus.Bus() + ret = False + # Wait for the presence service to start up + while not ret: + ret = dbus.dbus_bindings.bus_name_has_owner(bus._connection, PresenceService.DBUS_SERVICE) + time.sleep(0.2) class Session: """Takes care of running the shell and all the sugar processes""" -- cgit v0.9.1