Ejemplo n.º 1
0
 def stop(cls):
     """Stop a timer."""
     # DO NOT call TimeDisplay.stop_time() again; it will double the time
     cls._set_mode_save()
     TimeDisplay.reset_time()
     if cls.stop_callback:
         cls.stop_callback()
Ejemplo n.º 2
0
 def stop(cls):
     """Stop a timer."""
     # stop_time() already called from prompt_stop()
     cls._set_mode_save()
     TimeDisplay.reset_time()
     for callback in cls.stop_callback:
         callback()
Ejemplo n.º 3
0
    def reset(cls):
        """Discard a stopped timer's time instead of saving it."""

        cls._set_mode_stopped()
        TimeDisplay.reset_time(erase=True)
        TimeDisplay.show_default()
        Notes.clear()
        for callback in cls.reset_callback:
            callback()
Ejemplo n.º 4
0
    def save(cls):
        """Save a stopped timer's time to the log."""

        cls._set_mode_stopped()
        notes = Notes.get_text()
        timestamp = TimeDisplay.get_timestamp()
        TimeLog.add_to_log(timestamp, *TimeDisplay.get_time(), notes)
        LogView.refresh()
        Notes.clear()
        TimeDisplay.stop_time()
        TimeDisplay.reset_time()
        if cls.save_callback:
            cls.save_callback()