Exemplo n.º 1
0
 def check(cls):
     """Check if it's time to show a notification."""
     if not cls.interval:
         return
     if TimeDisplay.get_time_min() >= cls.next_at:
         return True
     return False
Exemplo n.º 2
0
    def notify(cls, hours, minutes, seconds):
        """Display notification."""
        if not cls.check():
            return
        cls.last_at = TimeDisplay.get_time_min()
        activity = Notes.get_text()
        if activity:
            message = random.choice(
                cls.prompt_with_note).substitute(task=activity)
        else:
            message = random.choice(cls.prompt_no_note)

        # Show the notification
        SysTray.popup(message)
        # Determine when next notification should appear
        cls.calculate_next()