Do not pass the timeout argument if we are using the in-process console
This commit is contained in:
parent
b1c7385204
commit
1cfd208f7b
@ -47,10 +47,7 @@ class ConsoleDbusService(dbus.service.Object):
|
|||||||
@dbus.service.method('org.laptop.Sugar.Console',
|
@dbus.service.method('org.laptop.Sugar.Console',
|
||||||
in_signature="saias", out_signature="")
|
in_signature="saias", out_signature="")
|
||||||
def log(self, module_id, levels, messages):
|
def log(self, module_id, levels, messages):
|
||||||
i = 0
|
self._console.log(module_id, levels, messages)
|
||||||
while i < len(levels):
|
|
||||||
self._console.log(levels[i], module_id, messages[i])
|
|
||||||
i += 1
|
|
||||||
|
|
||||||
class ConsoleWindow(gtk.Window):
|
class ConsoleWindow(gtk.Window):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -122,6 +119,9 @@ class ConsoleWindow(gtk.Window):
|
|||||||
page = self._nb.page_num(self._consoles[page_id])
|
page = self._nb.page_num(self._consoles[page_id])
|
||||||
self._nb.set_current_page(page)
|
self._nb.set_current_page(page)
|
||||||
|
|
||||||
def log(self, level, page_id, message):
|
def log(self, page_id, levels, messages):
|
||||||
console = self._get_console(page_id)
|
console = self._get_console(page_id)
|
||||||
console.log(level, message)
|
i = 0
|
||||||
|
while i < len(levels):
|
||||||
|
console.log(levels[i], messages[i])
|
||||||
|
i += 1
|
||||||
|
@ -25,7 +25,9 @@ class MessageQueue:
|
|||||||
bus = dbus.SessionBus()
|
bus = dbus.SessionBus()
|
||||||
con = bus._connection
|
con = bus._connection
|
||||||
if dbus.dbus_bindings.bus_name_has_owner(con, CONSOLE_BUS_NAME):
|
if dbus.dbus_bindings.bus_name_has_owner(con, CONSOLE_BUS_NAME):
|
||||||
|
print >> sys.stderr, 'Setup now'
|
||||||
self.setup_console()
|
self.setup_console()
|
||||||
|
else:
|
||||||
bus.add_signal_receiver(self.__name_owner_changed,
|
bus.add_signal_receiver(self.__name_owner_changed,
|
||||||
dbus_interface = "org.freedesktop.DBus",
|
dbus_interface = "org.freedesktop.DBus",
|
||||||
signal_name = "NameOwnerChanged")
|
signal_name = "NameOwnerChanged")
|
||||||
@ -51,8 +53,12 @@ class MessageQueue:
|
|||||||
if self._console == None or len(self._messages) == 0:
|
if self._console == None or len(self._messages) == 0:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if isinstance(self._console, dbus.Interface):
|
||||||
self._console.log(self._console_id, self._levels,
|
self._console.log(self._console_id, self._levels,
|
||||||
self._messages, timeout = 1000)
|
self._messages, timeout = 1000)
|
||||||
|
else:
|
||||||
|
self._console.log(self._console_id, self._levels,
|
||||||
|
self._messages)
|
||||||
|
|
||||||
self._levels = []
|
self._levels = []
|
||||||
self._messages = []
|
self._messages = []
|
||||||
|
Loading…
Reference in New Issue
Block a user