diff options
author | Guillaume Desmottes <cassidy@cass-wks.(none)> | 2007-08-28 18:05:54 (GMT) |
---|---|---|
committer | Guillaume Desmottes <cassidy@cass-wks.(none)> | 2007-08-28 18:05:54 (GMT) |
commit | 7118cb59bcfe8d94257d25c67720e724a2e41779 (patch) | |
tree | 6010bbee058647760c0a7c329c6006052781f5e7 /shell/sugar-shell | |
parent | c30bb01b0e37f26190835ed6fd42b68a8a2e2ad8 (diff) |
rename TP_DEBUG to SUGAR_TP_DEBUG and make it works with Salut
Diffstat (limited to 'shell/sugar-shell')
-rwxr-xr-x | shell/sugar-shell | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/shell/sugar-shell b/shell/sugar-shell index b2b9622..9786aa9 100755 --- a/shell/sugar-shell +++ b/shell/sugar-shell @@ -69,7 +69,7 @@ def _setup_translations(): gettext.bindtextdomain(domain, env.get_locale_path()) gettext.textdomain(domain) -def check_gabble(bus_name): +def check_cm(bus_name): try: import dbus bus = dbus.SessionBus() @@ -93,7 +93,7 @@ def main(): gtk.main() profile.update() - if os.environ.has_key("TP_DEBUG"): + if os.environ.has_key("SUGAR_TP_DEBUG"): # Allow the user time to start up telepathy connection managers # using the Sugar DBus bus address import time @@ -101,18 +101,24 @@ def main(): registry = ManagerRegistry() registry.LoadManagers() - try: - gabble = registry.services["gabble"] - except KeyError: - raise RuntimeError("Gabble connection manager not found!") - while not check_gabble(gabble['busname']): - print "Waiting for gabble on: DBUS_SESSION_BUS_ADDRESS=%s" % os.environ["DBUS_SESSION_BUS_ADDRESS"] + debug_flags = os.environ["SUGAR_TP_DEBUG"].split(',') + for cm_name in debug_flags: + if cm_name not in ["gabble", "salut"]: + continue + try: - time.sleep(5) - except KeyboardInterrupt: - print "Got Ctrl+C, continuing..." - break + cm = registry.services[cm_name] + except KeyError: + print RuntimeError("%s connection manager not found!" % cm_name) + + while not check_cm(cm['busname']): + print "Waiting for %s on: DBUS_SESSION_BUS_ADDRESS=%s" %(cm_name, os.environ["DBUS_SESSION_BUS_ADDRESS"]) + try: + time.sleep(5) + except KeyboardInterrupt: + print "Got Ctrl+C, continuing..." + break model = ShellModel() shell = Shell(model) |