def build_set_locked(self, args):
        try:
            boolean = to_bool(args[0])
        except Exception, e:
            return str(e)
        else:
            self.locked = boolean
            self._locked = boolean
            self.save()
            if self.linked_exit:
                self.to_room.exits[self.linked_exit].locked = boolean
                self.to_room.exits[self.linked_exit]._locked = boolean
                self.to_room.exits[self.linked_exit].save()
            return 'Exit attribute "locked" is now %s.\n' % str(boolean)
dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/models/room_exit.py/RoomExit.build_set_locked/original