From ddcbe9f3a277c8e454aeadcedfc6cad81a997a19 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 10 Jun 2008 16:43:45 +0200 Subject: [PATCH] some code beautifying incl. waitForRx --- DbgTerminal.py | 8 ++++---- MainControlWindow.py | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/DbgTerminal.py b/DbgTerminal.py index 543cadc..6fec9f3 100644 --- a/DbgTerminal.py +++ b/DbgTerminal.py @@ -88,16 +88,16 @@ class DbgTerminal (vte.Terminal): return len(self.history) def waitForRx(self, rx, start): - curr = start - while True: - for no in range(max(curr-1,start), self.getHistoryLen()): + assert( curr>=start ) + for no in range(curr, self.getHistoryLen()): line = self.history[no] if rx.search(line): return no, line - curr = max(start,self.getHistoryLen()) + #Do not forget the last line + curr = max(start,self.getHistoryLen()-1) gtk.main_iteration() diff --git a/MainControlWindow.py b/MainControlWindow.py index 5ea0fb8..c8706d9 100644 --- a/MainControlWindow.py +++ b/MainControlWindow.py @@ -63,8 +63,10 @@ class MainControlWindow (gtk.Window): #Install handlers self.runBtnHandler = self.runBtn.connect('clicked', self.runBtnClicked) - self.continueBtnHandler = self.continueBtn.connect('clicked', self.continueBtnClicked) - self.stepoverBtnHandler = self.stepoverBtn.connect('clicked', self.stepoverBtnClicked) + self.continueBtnHandler = self.continueBtn.connect('clicked', \ + self.continueBtnClicked) + self.stepoverBtnHandler = self.stepoverBtn.connect('clicked', \ + self.stepoverBtnClicked) self.stepinBtnHandler = self.stepinBtn.connect('clicked', self.stepinBtnClicked) self.quitBtnHandler = self.quitBtn.connect('clicked', self.quitBtnClicked) -- 2.39.5