]> git.sthu.org Git - pygdb.git/commitdiff
some code beautifying incl. waitForRx
authorStefan Huber <shuber2@gmail.com>
Tue, 10 Jun 2008 14:43:45 +0000 (16:43 +0200)
committerStefan Huber <shuber2@gmail.com>
Tue, 10 Jun 2008 14:43:45 +0000 (16:43 +0200)
DbgTerminal.py
MainControlWindow.py

index 543cadc893144bc0c378bb2cd4e09be082f9b76a..6fec9f3e789f40cff60e62de2561d271ca81164e 100644 (file)
@@ -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()
 
 
index 5ea0fb8f4cb38e7f77081a52159d614fff2ace32..c8706d9b0368717d579f457c0a4e511cf31cd48b 100644 (file)
@@ -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)