rename TP_DEBUG to SUGAR_TP_DEBUG and make it works with Salut
This commit is contained in:
parent
c30bb01b0e
commit
7118cb59bc
@ -69,7 +69,7 @@ def _setup_translations():
|
|||||||
gettext.bindtextdomain(domain, env.get_locale_path())
|
gettext.bindtextdomain(domain, env.get_locale_path())
|
||||||
gettext.textdomain(domain)
|
gettext.textdomain(domain)
|
||||||
|
|
||||||
def check_gabble(bus_name):
|
def check_cm(bus_name):
|
||||||
try:
|
try:
|
||||||
import dbus
|
import dbus
|
||||||
bus = dbus.SessionBus()
|
bus = dbus.SessionBus()
|
||||||
@ -93,7 +93,7 @@ def main():
|
|||||||
gtk.main()
|
gtk.main()
|
||||||
profile.update()
|
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
|
# Allow the user time to start up telepathy connection managers
|
||||||
# using the Sugar DBus bus address
|
# using the Sugar DBus bus address
|
||||||
import time
|
import time
|
||||||
@ -101,18 +101,24 @@ def main():
|
|||||||
|
|
||||||
registry = ManagerRegistry()
|
registry = ManagerRegistry()
|
||||||
registry.LoadManagers()
|
registry.LoadManagers()
|
||||||
try:
|
|
||||||
gabble = registry.services["gabble"]
|
|
||||||
except KeyError:
|
|
||||||
raise RuntimeError("Gabble connection manager not found!")
|
|
||||||
|
|
||||||
while not check_gabble(gabble['busname']):
|
debug_flags = os.environ["SUGAR_TP_DEBUG"].split(',')
|
||||||
print "Waiting for gabble on: DBUS_SESSION_BUS_ADDRESS=%s" % os.environ["DBUS_SESSION_BUS_ADDRESS"]
|
for cm_name in debug_flags:
|
||||||
|
if cm_name not in ["gabble", "salut"]:
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
time.sleep(5)
|
cm = registry.services[cm_name]
|
||||||
except KeyboardInterrupt:
|
except KeyError:
|
||||||
print "Got Ctrl+C, continuing..."
|
print RuntimeError("%s connection manager not found!" % cm_name)
|
||||||
break
|
|
||||||
|
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()
|
model = ShellModel()
|
||||||
shell = Shell(model)
|
shell = Shell(model)
|
||||||
|
Loading…
Reference in New Issue
Block a user