Commit 52583643 authored by Guillaume Seguin's avatar Guillaume Seguin

Merge branch 'master' of github.com:kliment/Printrun

parents 44649c64 8c3cbe06
...@@ -1221,32 +1221,34 @@ class pronsole(cmd.Cmd): ...@@ -1221,32 +1221,34 @@ class pronsole(cmd.Cmd):
def recvcb_actions(self, l): def recvcb_actions(self, l):
if l.startswith("!!"): if l.startswith("!!"):
self.do_pause(None) self.do_pause(None)
msg = l.split(" ", 1)[1] msg = l.split(" ", 1)
if self.silent is False: self.logError(msg.ljust(15)) if len(msg) > 1 and self.silent is False: self.logError(msg[1].ljust(15))
sys.stdout.write(self.promptf()) sys.stdout.write(self.promptf())
sys.stdout.flush() sys.stdout.flush()
return True return True
elif l.startswith("//"): elif l.startswith("//"):
command = l.split(" ", 1)[1] command = l.split(" ", 1)
self.log(_("Received command %s") % command) if len(command) > 1:
command = command.split(":")
if len(command) == 2 and command[0] == "action":
command = command[1] command = command[1]
if command == "pause": self.log(_("Received command %s") % command)
self.do_pause(None) command = command.split(":")
sys.stdout.write(self.promptf()) if len(command) == 2 and command[0] == "action":
sys.stdout.flush() command = command[1]
return True if command == "pause":
elif command == "resume": self.do_pause(None)
self.do_resume(None) sys.stdout.write(self.promptf())
sys.stdout.write(self.promptf()) sys.stdout.flush()
sys.stdout.flush() return True
return True elif command == "resume":
elif command == "disconnect": self.do_resume(None)
self.do_disconnect(None) sys.stdout.write(self.promptf())
sys.stdout.write(self.promptf()) sys.stdout.flush()
sys.stdout.flush() return True
return True elif command == "disconnect":
self.do_disconnect(None)
sys.stdout.write(self.promptf())
sys.stdout.flush()
return True
return False return False
def recvcb(self, l): def recvcb(self, l):
......
...@@ -1676,27 +1676,29 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1676,27 +1676,29 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
if l.startswith("!!"): if l.startswith("!!"):
if not self.paused: if not self.paused:
wx.CallAfter(self.pause) wx.CallAfter(self.pause)
msg = l.split(" ", 1)[1] msg = l.split(" ", 1)
if not self.p.loud: if len(msg) > 1 and not self.p.loud:
wx.CallAfter(self.addtexttolog, msg + "\n") wx.CallAfter(self.addtexttolog, msg[1] + "\n")
return True return True
elif l.startswith("//"): elif l.startswith("//"):
command = l.split(" ", 1)[1] command = l.split(" ", 1)
self.log(_("Received command %s") % command) if len(command) > 1:
command = command.split(":")
if len(command) == 2 and command[0] == "action":
command = command[1] command = command[1]
if command == "pause": self.log(_("Received command %s") % command)
if not self.paused: command = command.split(":")
wx.CallAfter(self.pause) if len(command) == 2 and command[0] == "action":
return True command = command[1]
elif command == "resume": if command == "pause":
if self.paused: if not self.paused:
wx.CallAfter(self.pause) wx.CallAfter(self.pause)
return True return True
elif command == "disconnect": elif command == "resume":
wx.CallAfter(self.disconnect) if self.paused:
return True wx.CallAfter(self.pause)
return True
elif command == "disconnect":
wx.CallAfter(self.disconnect)
return True
return False return False
def recvcb(self, l): def recvcb(self, 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