@classmethod
    def update_next(cls, seconds, now):
        """Setup theme for next update."""

        # Reset tracker members
        cls.next_change = None
        cls.day = None

        # Try and find the closest time point to switch the theme
        closest = None
        lowest = None
        for t in cls.themes:
            if seconds < t.time and (closest is None or t.time < closest.time):
                closest = t
            if lowest is None or t.time < lowest.time:
                lowest = t

        # Select the closest if there was one
        if closest is not None:
            cls.next_change = closest
        elif lowest is not None:
            cls.next_change = lowest
        if lowest is not None:
            cls.lowest = lowest

        if (cls.next_change.time == cls.lowest.time and seconds < cls.lowest.time):
            # The next change is the first of the next day
            # But the time is not greater meaning we are already
            # the next day, intialize to -1 to signify the last good
            # change was yesterday.
            cls.day = -1
        else:
            # Copy the day in which the next change was picked
            cls.day = now.day

        debug_log("Today = %d" % cls.day)
        debug_log("%s - Next Change @ %s" % (time.ctime(), str(cls.next_change)))
dataset/ETHPy150Open facelessuser/ThemeScheduler/ThemeScheduler.py/ThemeScheduler.update_next/original