add a sanity check function. This probably shouldn't exist, but is useful right now

This commit is contained in:
Chris Jones 2009-11-20 09:30:50 -06:00
parent aa531014ef
commit 1db6a242b1
1 changed files with 11 additions and 0 deletions

View File

@ -122,6 +122,17 @@ class Paned(Container):
else: else:
dbg("Paned::wrapcloseterm: self.closeterm failed") dbg("Paned::wrapcloseterm: self.closeterm failed")
def hoover(self):
"""Check that we still have a reason to exist"""
if len(self.children) == 1:
dbg('Paned::hoover: We only have one child, die')
parent = self.get_parent()
parent.remove(self)
child = self.children[0]
self.remove(child)
parent.add(child)
del(self)
def resizeterm(self, widget, keyname): def resizeterm(self, widget, keyname):
"""Handle a keyboard event requesting a terminal resize""" """Handle a keyboard event requesting a terminal resize"""
if keyname in ['up', 'down'] and isinstance(self, gtk.VPaned): if keyname in ['up', 'down'] and isinstance(self, gtk.VPaned):