- if len(msg) > 8 and msg[:8] == 'TERRAIN ':
- self.widget2.update_terrain(msg[8:])
- elif len(msg) > 11 and msg[:11] == 'POSITION_Y ':
- self.widget2.update_position_y(msg[11:])
- elif len(msg) > 11 and msg[:11] == 'POSITION_X ':
- self.widget2.update_position_x(msg[11:])
+ found_command = False
+ try:
+ found_command = (
+ mapdraw_command('TERRAIN\n', 'update_terrain') or
+ mapdraw_command('POSITION_Y ', 'update_position_y') or
+ mapdraw_command('POSITION_X ', 'update_position_x'))
+ except Exception as e:
+ self.widget1.set_text('TROUBLESOME ARGUMENT: ' + msg + '\n' +
+ str(e))