Commit 5c8bc44f authored by Guillaume Seguin's avatar Guillaume Seguin

Remove (now useless ?) capture mechanisms from pronterface

parent c298d1be
...@@ -560,15 +560,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -560,15 +560,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
pronsole.pronsole.start_macro(self, macro_name, old_macro_definition) pronsole.pronsole.start_macro(self, macro_name, old_macro_definition)
def catchprint(self, l): def catchprint(self, l):
if self.capture_skip_newline and len(l) and not len(l.strip("\n\r")): wx.CallAfter(self.addtexttolog, l)
self.capture_skip_newline = False
return
for pat in self.capture_skip.keys():
if self.capture_skip[pat] > 0 and pat.match(l):
self.capture_skip[pat] -= 1
self.capture_skip_newline = True
return
wx.CallAfter(self.addtexttolog,l);
def project(self,event): def project(self,event):
from printrun import projectlayer from printrun import projectlayer
...@@ -1313,9 +1305,6 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -1313,9 +1305,6 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if self.monitor and self.p.online: if self.monitor and self.p.online:
if self.sdprinting: if self.sdprinting:
self.p.send_now("M27") self.p.send_now("M27")
if not hasattr(self, "auto_monitor_pattern"):
self.auto_monitor_pattern = re.compile(r"(ok\s+)?T:[\d\.]+(\s+B:[\d\.]+)?(\s+@:[\d\.]+)?\s*")
self.capture_skip[self.auto_monitor_pattern] = self.capture_skip.setdefault(self.auto_monitor_pattern, 0) + 1
self.p.send_now("M105") self.p.send_now("M105")
cur_time = time.time() cur_time = time.time()
while time.time() < cur_time + self.monitor_interval: while time.time() < cur_time + self.monitor_interval:
...@@ -1331,25 +1320,6 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -1331,25 +1320,6 @@ class PronterWindow(MainWindow, pronsole.pronsole):
pass pass
wx.CallAfter(self.statusbar.SetStatusText, _("Not connected to printer.")) wx.CallAfter(self.statusbar.SetStatusText, _("Not connected to printer."))
def capture(self, func, *args, **kwargs):
stdout = sys.stdout
cout = None
try:
cout = self.cout
except:
pass
if cout is None:
cout = cStringIO.StringIO()
sys.stdout = cout
retval = None
try:
retval = func(*args,**kwargs)
except:
traceback.print_exc()
sys.stdout = stdout
return retval
def recvcb(self, l): def recvcb(self, l):
isreport = False isreport = False
if "ok C:" in l or "Count" in l: if "ok C:" in l or "Count" in l:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment