Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorDan Williams <dcbw@localhost.localdomain>2006-07-24 16:27:52 (GMT)
committer Dan Williams <dcbw@localhost.localdomain>2006-07-24 16:27:52 (GMT)
commitbfab84acc9cfea367ac08086eb4de0d753d91653 (patch)
treeb320af69ea9b037f162baf6f51d6ba6cbc9e9508 /shell
parent3798f29a6b18e26e85178a0c924cfcfc89c4422d (diff)
Poll for PS readiness rather than a hard wait time
Diffstat (limited to 'shell')
-rw-r--r--shell/Session.py13
1 files changed, 10 insertions, 3 deletions
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"""