mildly change the debugging output of objects, and handle ^C a little better

This commit is contained in:
Chris Jones 2009-12-23 16:40:54 +00:00
parent f33dc6f28a
commit df317bd2cd
3 changed files with 13 additions and 6 deletions

View File

@ -68,7 +68,7 @@ class Container(object):
if self.cnxids.has_key(widget): if self.cnxids.has_key(widget):
for cnxid in self.cnxids[widget]: for cnxid in self.cnxids[widget]:
dbg('Container::disconnect_child: removing handler on %s' % dbg('Container::disconnect_child: removing handler on %s' %
widget.__class__.__name__) type(widget))
widget.disconnect(cnxid) widget.disconnect(cnxid)
del(self.cnxids[widget]) del(self.cnxids[widget])

View File

@ -47,18 +47,21 @@ class Terminator(Borg):
def register_window(self, window): def register_window(self, window):
"""Register a new window widget""" """Register a new window widget"""
if window not in self.windows: if window not in self.windows:
dbg('Terminator::register_window: registering %s' % window) dbg('Terminator::register_window: registering %s:%s' % (id(window),
type(window)))
self.windows.append(window) self.windows.append(window)
def deregister_window(self, window): def deregister_window(self, window):
"""de-register a window widget""" """de-register a window widget"""
dbg('Terminator::deregister_window: de-registering %s' % window) dbg('Terminator::deregister_window: de-registering %s:%s' %
(id(window), type(window)))
self.windows.remove(window) self.windows.remove(window)
def register_terminal(self, terminal): def register_terminal(self, terminal):
"""Register a new terminal widget""" """Register a new terminal widget"""
if terminal not in self.terminals: if terminal not in self.terminals:
dbg('Terminator::register_terminal: registering %s' % terminal) dbg('Terminator::register_terminal: registering %s:%s' %
(id(terminal), type(terminal)))
self.terminals.append(terminal) self.terminals.append(terminal)
terminal.connect('ungroup-all', self.ungroup_all) terminal.connect('ungroup-all', self.ungroup_all)
terminal.connect('navigate', self.navigate_terminal) terminal.connect('navigate', self.navigate_terminal)
@ -66,7 +69,8 @@ class Terminator(Borg):
def deregister_terminal(self, terminal): def deregister_terminal(self, terminal):
"""De-register a terminal widget""" """De-register a terminal widget"""
dbg('Terminator::deregister_terminal: de-registering %s' % terminal) dbg('Terminator::deregister_terminal: de-registering %s:%s' %
(id(terminal), type(terminal)))
self.terminals.remove(terminal) self.terminals.remove(terminal)
if len(self.terminals) == 0: if len(self.terminals) == 0:

View File

@ -22,4 +22,7 @@ term.spawn_child()
window.connect("destroy", on_window_destroyed) window.connect("destroy", on_window_destroyed)
gtk.main() try:
gtk.main()
except KeyboardInterrupt:
pass