Commit 8c3cbe06 authored by Guillaume Seguin's avatar Guillaume Seguin

WIP #575: Strenghten // handling

parent 3aabfbe0
...@@ -1227,26 +1227,28 @@ class pronsole(cmd.Cmd): ...@@ -1227,26 +1227,28 @@ class pronsole(cmd.Cmd):
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):
......
...@@ -1681,22 +1681,24 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1681,22 +1681,24 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
wx.CallAfter(self.addtexttolog, msg[1] + "\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