Commit 9e811f8b authored by Guillaume Seguin's avatar Guillaume Seguin

Minor fixes related to #575

parent 1e18c27b
...@@ -61,7 +61,7 @@ from .excluder import Excluder ...@@ -61,7 +61,7 @@ from .excluder import Excluder
from .settings import wxSetting, HiddenSetting, StringSetting, SpinSetting, \ from .settings import wxSetting, HiddenSetting, StringSetting, SpinSetting, \
FloatSpinSetting, BooleanSetting, StaticTextSetting FloatSpinSetting, BooleanSetting, StaticTextSetting
from printrun import gcoder from printrun import gcoder
from .pronsole import REPORT_NONE, REPORT_POS, REPORT_TEMP from .pronsole import REPORT_NONE, REPORT_POS, REPORT_TEMP, REPORT_MANUAL
class ConsoleOutputHandler(object): class ConsoleOutputHandler(object):
"""Handle console output. All messages go through the logging submodule. We setup a logging handler to get logged messages and write them to both stdout (unless a log file path is specified, in which case we add another logging handler to write to this file) and the log panel. """Handle console output. All messages go through the logging submodule. We setup a logging handler to get logged messages and write them to both stdout (unless a log file path is specified, in which case we add another logging handler to write to this file) and the log panel.
...@@ -1675,7 +1675,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1675,7 +1675,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
def recvcb_actions(self, l): def recvcb_actions(self, l):
if l.startswith("!!"): if l.startswith("!!"):
if not self.paused: if not self.paused:
self.pause() wx.CallAfter(self.pause)
msg = l.split(" ", 1)[1] msg = l.split(" ", 1)[1]
if not self.p.loud: if not self.p.loud:
wx.CallAfter(self.addtexttolog, msg + "\n") wx.CallAfter(self.addtexttolog, msg + "\n")
...@@ -1688,14 +1688,14 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1688,14 +1688,14 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
command = command[1] command = command[1]
if command == "pause": if command == "pause":
if not self.paused: if not self.paused:
wx.CallAfter(lambda: self.pause()) wx.CallAfter(self.pause)
return True return True
elif command == "resume": elif command == "resume":
if self.paused: if self.paused:
wx.CallAfter(lambda: self.pause()) wx.CallAfter(self.pause)
return True return True
elif command == "disconnect": elif command == "disconnect":
wx.CallAfter(lambda: self.disconnect()) wx.CallAfter(self.disconnect)
return True return True
return False return False
...@@ -1709,7 +1709,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1709,7 +1709,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
elif report_type & REPORT_TEMP: elif report_type & REPORT_TEMP:
wx.CallAfter(self.tempdisp.SetLabel, self.tempreadings.strip().replace("ok ", "")) wx.CallAfter(self.tempdisp.SetLabel, self.tempreadings.strip().replace("ok ", ""))
self.update_tempdisplay() self.update_tempdisplay()
if not self.p.loud and (l not in ["ok", "wait"] and not isreport): if not self.p.loud and (l not in ["ok", "wait"] and (not isreport or report_type & REPORT_MANUAL)):
wx.CallAfter(self.addtexttolog, l + "\n") wx.CallAfter(self.addtexttolog, l + "\n")
for listener in self.recvlisteners: for listener in self.recvlisteners:
listener(l) listener(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