Skip to main content

Module pause

Module pause 

Source
Expand description

Pause state shared between the probe and the tray.

Stored as a single-line file at paths::paused_until_path():

  • absent file → not paused
  • file containing indefinite → paused with no end time
  • file containing an RFC 3339 timestamp → paused until that instant

Both the probe (which honours the pause in its scheduler) and the tray (which writes the file when the user picks a duration) read and write through this module so the format stays in sync.

Enums§

PauseState

Functions§

read_pause_state
Read the current pause state from disk. Returns None when the file is missing, empty, or the timestamp has already elapsed (treated as “no longer paused”; callers may delete the stale file).
write_pause_state
Write the pause state to disk, or remove the file when None.