+ elif self.mode.name == 'control_pw_type' and key == '\n':
+ if len(self.input_) != 1:
+ self.log_msg('@ entered non-single-char, therefore aborted')
+ self.switch_mode('admin')
+ else:
+ self.tile_control_char = self.input_
+ self.switch_mode('control_pw_pw')
+ elif self.mode.name == 'admin_thing_protect' and key == '\n':
+ if len(self.input_) != 1:
+ self.log_msg('@ entered non-single-char, therefore aborted')
+ else:
+ self.send('THING_PROTECTION %s %s' % (self.thing_selected.id_,
+ quote(self.input_)))
+ self.log_msg('@ sent new protection character for thing')
+ self.switch_mode('admin')
+ elif self.mode.name == 'control_tile_type' and key == '\n':
+ if len(self.input_) != 1:
+ self.log_msg('@ entered non-single-char, therefore aborted')
+ self.switch_mode('admin')
+ else:
+ self.tile_control_char = self.input_
+ self.switch_mode('control_tile_draw')