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

WIP #575: Strenghten // handling

parent 3aabfbe0
......@@ -1227,26 +1227,28 @@ class pronsole(cmd.Cmd):
sys.stdout.flush()
return True
elif l.startswith("//"):
command = l.split(" ", 1)[1]
self.log(_("Received command %s") % command)
command = command.split(":")
if len(command) == 2 and command[0] == "action":
command = l.split(" ", 1)
if len(command) > 1:
command = command[1]
if command == "pause":
self.do_pause(None)
sys.stdout.write(self.promptf())
sys.stdout.flush()
return True
elif command == "resume":
self.do_resume(None)
sys.stdout.write(self.promptf())
sys.stdout.flush()
return True
elif command == "disconnect":
self.do_disconnect(None)
sys.stdout.write(self.promptf())
sys.stdout.flush()
return True
self.log(_("Received command %s") % command)
command = command.split(":")
if len(command) == 2 and command[0] == "action":
command = command[1]
if command == "pause":
self.do_pause(None)
sys.stdout.write(self.promptf())
sys.stdout.flush()
return True
elif command == "resume":
self.do_resume(None)
sys.stdout.write(self.promptf())
sys.stdout.flush()
return True
elif command == "disconnect":
self.do_disconnect(None)
sys.stdout.write(self.promptf())
sys.stdout.flush()
return True
return False
def recvcb(self, l):
......
......@@ -1681,22 +1681,24 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
wx.CallAfter(self.addtexttolog, msg[1] + "\n")
return True
elif l.startswith("//"):
command = l.split(" ", 1)[1]
self.log(_("Received command %s") % command)
command = command.split(":")
if len(command) == 2 and command[0] == "action":
command = l.split(" ", 1)
if len(command) > 1:
command = command[1]
if command == "pause":
if not self.paused:
wx.CallAfter(self.pause)
return True
elif command == "resume":
if self.paused:
wx.CallAfter(self.pause)
return True
elif command == "disconnect":
wx.CallAfter(self.disconnect)
return True
self.log(_("Received command %s") % command)
command = command.split(":")
if len(command) == 2 and command[0] == "action":
command = command[1]
if command == "pause":
if not self.paused:
wx.CallAfter(self.pause)
return True
elif command == "resume":
if self.paused:
wx.CallAfter(self.pause)
return True
elif command == "disconnect":
wx.CallAfter(self.disconnect)
return True
return False
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