From 1db6a242b12ace46b463e4afaaa1359316808fe8 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Fri, 20 Nov 2009 09:30:50 -0600 Subject: [PATCH] add a sanity check function. This probably shouldn't exist, but is useful right now --- terminatorlib/paned.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index c4850a8a..15b558bb 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -122,6 +122,17 @@ class Paned(Container): else: 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): """Handle a keyboard event requesting a terminal resize""" if keyname in ['up', 'down'] and isinstance(self, gtk.VPaned):