From da0cab63c7cb4b3ddc7fd4d2fc082c48cf4c6825 Mon Sep 17 00:00:00 2001 From: Guillaume Seguin Date: Sat, 18 May 2013 18:38:54 +0200 Subject: [PATCH] Don't limit sentlines queue size --- pronterface.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pronterface.py b/pronterface.py index cfcb8e4..1ed94d9 100755 --- a/pronterface.py +++ b/pronterface.py @@ -120,7 +120,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): self.skeinp = None self.monitor_interval = 3 self.paused = False - self.sentlines = Queue.Queue(30) + self.sentlines = Queue.Queue(0) self.cpbuttons = [ SpecialButton(_("Motors off"), ("M84"), (250, 250, 250), None, 0, _("Switch all motors off")), SpecialButton(_("Check temp"), ("M105"), (225, 200, 200), (2, 5), (1, 1), _("Check current hotend temperature")), @@ -256,7 +256,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): pass try: self.sentlines.put_nowait(line) - except: + except Queue.Full: pass #threading.Thread(target = self.gviz.addgcode, args = (line, 1)).start() #self.gwindow.p.addgcode(line, hilight = 1) @@ -1091,11 +1091,8 @@ class PronterWindow(MainWindow, pronsole.pronsole): break time.sleep(0.25) while not self.sentlines.empty(): - try: - gc = self.sentlines.get_nowait() - wx.CallAfter(self.gviz.addgcode, gc, 1) - except: - break + gc = self.sentlines.get_nowait() + wx.CallAfter(self.gviz.addgcode, gc, 1) wx.CallAfter(self.status.SetStatusText, _("Not connected to printer.")) def capture(self, func, *args, **kwargs):