From 95ab530bdc8d2b4f69f5f4d60ec829100a438877 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Wed, 22 Feb 2017 14:03:49 +0100 Subject: [PATCH] Added versioning to robot project --- script/local.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/local.py b/script/local.py index 4d2cd31..e6ca0ac 100644 --- a/script/local.py +++ b/script/local.py @@ -14,7 +14,8 @@ class RobotTCP(TcpDevice): self.retries = retries self.header = None self.trailer = "\n" - self.array_separator = ',' + self.array_separator = '|' + self.cmd_separator = ' ' self.msg_id = 0 self.setPolling(1000) @@ -46,8 +47,8 @@ class RobotTCP(TcpDevice): msg = str(command) if len(argv)>10: raise Exception("Exceeded maximum number of parameters") - for arg in argv: - msg = msg + "," + str(arg) + for i in range(len(argv)): + msg += (self.cmd_separator if (i==0) else self.array_separator) + str(argv[i]) rx = self.call(msg) if rx.count(self.array_separator)>0: return rx.split(self.array_separator)