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)
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)
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)