'This method checks if there are any light sources in the room.
If there isn\'t it makes sure to add the dark cmdset to all
characters in the room. It is called whenever characters enter
the room and also by the Light sources when they turn on.
Args:
exclude (Object): An object to not include in the light check.'

def check_light_state(self, exclude=None):

    if any((self._carries_light(obj) for obj in self.contents if (obj != exclude))):
        self.locks.add('view:all()')
        self.cmdset.remove(DarkCmdSet)
        self.db.is_lit = True
        for char in (obj for obj in self.contents if obj.has_player):
            char.msg('The    room    is    lit    up.')
    else:
        self.db.is_lit = False
        self.locks.add('view:false()')
        self.cmdset.add(DarkCmdSet, permanent=True)
        for char in (obj for obj in self.contents if obj.has_player):
            if char.is_superuser:
                char.msg('You    are    Superuser,    so    you    are    not    affected    by    the    dark    state.')
            else:
                char.msg('The    room    is    completely    dark.')
