Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-08-22 08:37:24 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-08-22 08:37:24 (GMT)
commit49073039e94685f697389712dbed35f5d39e4270 (patch)
treef8226c302fe1724d33e30c4ad2aef5f6bcec54b3
parent1017bba22d7e72d84b5e2b59611077bf78e66e93 (diff)
Run the session dbus from the emulator. The olpc run his own.
-rw-r--r--shell/session/Emulator.py24
-rw-r--r--shell/session/Session.py22
2 files changed, 22 insertions, 24 deletions
diff --git a/shell/session/Emulator.py b/shell/session/Emulator.py
index c18d92e..a46a46d 100644
--- a/shell/session/Emulator.py
+++ b/shell/session/Emulator.py
@@ -3,6 +3,7 @@ import socket
import sys
from session.Process import Process
+import sugar.env
def get_display_number():
"""Find a free display number trying to connect to 6000+ ports"""
@@ -53,6 +54,22 @@ class XnestProcess(Process):
Process.start(self)
os.environ['DISPLAY'] = ":%d" % (self._display)
+class DbusProcess(Process):
+ def __init__(self):
+ config = sugar.env.get_dbus_config()
+ cmd = "dbus-daemon --print-address --config-file %s" % config
+ Process.__init__(self, cmd)
+
+ def get_name(self):
+ return 'Dbus'
+
+ def start(self):
+ Process.start(self, True)
+ dbus_file = os.fdopen(self._stdout)
+ addr = dbus_file.readline().strip()
+ dbus_file.close()
+ os.environ["DBUS_SESSION_BUS_ADDRESS"] = addr
+
class Emulator:
"""The OLPC emulator"""
def start(self):
@@ -64,6 +81,9 @@ class Emulator:
process = XnestProcess()
process.start()
except:
- print('Cannot run the emulator. You need to install\
- Xephyr or Xnest.')
+ print 'Cannot run the emulator. You need to install \
+ Xephyr or Xnest.'
sys.exit(0)
+
+ process = DbusProcess()
+ process.start()
diff --git a/shell/session/Session.py b/shell/session/Session.py
index f5b7f9e..8af2c65 100644
--- a/shell/session/Session.py
+++ b/shell/session/Session.py
@@ -4,31 +4,12 @@ import gobject
import time
import re
-import dbus
-import dbus.dbus_bindings
-
from sugar.presence import PresenceService
from Shell import Shell
from ConsoleWindow import ConsoleWindow
from session.Process import Process
import sugar.env
-class DbusProcess(Process):
- def __init__(self):
- config = sugar.env.get_dbus_config()
- cmd = "dbus-daemon --print-address --config-file %s" % config
- Process.__init__(self, cmd)
-
- def get_name(self):
- return 'Dbus'
-
- def start(self):
- Process.start(self, True)
- dbus_file = os.fdopen(self._stdout)
- addr = dbus_file.readline().strip()
- dbus_file.close()
- os.environ["DBUS_SESSION_BUS_ADDRESS"] = addr
-
class MatchboxProcess(Process):
def __init__(self):
kbd_config = os.path.join(sugar.env.get_data_dir(), 'kbdconfig')
@@ -49,9 +30,6 @@ class Session:
def start(self):
"""Start the session"""
- process = DbusProcess()
- process.start()
-
PresenceService.start()
process = MatchboxProcess()