Getting presence service logging to work.

Don't lose debug state when switching tab.
This commit is contained in:
Marco Pesenti Gritti
2006-08-13 02:57:12 +02:00
parent dd7fff79f8
commit 6eb7117c25
4 changed files with 27 additions and 19 deletions
+5 -6
View File
@@ -16,7 +16,7 @@ import sugar.env
class DbusProcess(Process):
def __init__(self):
config = sugar.env.get_dbus_config()
cmd = "dbus-launch --exit-with-session --config-file %s" % config
cmd = "dbus-daemon --print-address --config-file %s" % config
Process.__init__(self, cmd)
def get_name(self):
@@ -25,8 +25,7 @@ class DbusProcess(Process):
def start(self):
Process.start(self, True)
dbus_file = os.fdopen(self._stdout)
regexp = re.compile('DBUS_SESSION_BUS_ADDRESS=\'(.*)\'\;')
addr = regexp.match(dbus_file.readline()).group(1)
addr = dbus_file.readline().strip()
dbus_file.close()
os.environ["DBUS_SESSION_BUS_ADDRESS"] = addr
@@ -54,14 +53,14 @@ class Session:
process = DbusProcess()
process.start()
console = ConsoleWindow()
sugar.logger.start('Shell', console)
PresenceService.start()
process = MatchboxProcess()
process.start()
console = ConsoleWindow()
sugar.logger.start('Shell', console)
shell = Shell(self._registry)
shell.set_console(console)
shell.start()