예제 #1
0
	def parse_command(self, command):
		try:
			cmd = protocol.parse_msg(command)
			signal_function = getattr(self.player, 'signal_' + cmd['command'])
			self.commands.append((signal_function,) + tuple(cmd.values())[1:])
			print('Will send command ' + str(list(str(k) + ' : ' + str(v) for (k,v) in cmd.items())))
		except ValueError as e:
			print('Error while parsing command:')
			print(e)
예제 #2
0
 def parse_command(self, command):
     try:
         cmd = protocol.parse_msg(command)
         signal_function = getattr(self.player, 'signal_' + cmd['command'])
         self.commands.append((signal_function, ) + tuple(cmd.values())[1:])
         print('Will send command ' +
               str(list(str(k) + ' : ' + str(v) for (k, v) in cmd.items())))
     except ValueError as e:
         print('Error while parsing command:')
         print(e)
예제 #3
0
 def parse_command(self, command):
     try:
         cmd = protocol.parse_msg(command)
         self.commands.append(cmd)
         print("Will send command " + str(list(str(k) + " : " + str(v) for (k, v) in cmd.items())))
     except ValueError as e:
         print("Error while parsing command:")
         print(e)