@classmethod
    def update_current(cls):
        """Set next theme."""

        if cls.next_change is not None:
            closest = None
            greatest = None
            seconds = get_current_time()[0]
            for t in cls.themes:
                if t.time <= seconds and (closest is None or t.time > closest.time):
                    closest = t
                elif greatest is None or t.time > greatest.time:
                    greatest = t
            if closest is None:
                closest = cls.next_change if greatest is None else greatest

            if closest is not None:
                cls.apply_changes(
                    closest.theme,
                    closest.msg,
                    closest.filters,
                    closest.ui_theme,
                    closest.command
                )
dataset/ETHPy150Open facelessuser/ThemeScheduler/ThemeScheduler.py/ThemeScheduler.update_current/original