adsfolio.gui.watch

Thread-owned PDF watch workers and their GUI-thread controller.

class adsfolio.gui.watch.LibraryWatchController(parent=None, *, worker_factory=None)[source]

Bases: PySide6.QtCore.QObject

Own one thread-owned watch worker per normalized library root.

Parameters:
detected
dismiss(event)[source]

Dismiss one current-session event.

Parameters:

event (adsfolio.pdf.watch_session.WatchEvent)

Return type:

None

failed
is_watching(root)[source]

Return whether a root has a currently started worker.

Parameters:

root (pathlib.Path)

Return type:

bool

outcome
pause_writes(root)[source]

Pause worker catalog writes while retaining filesystem intake.

Parameters:

root (pathlib.Path)

Return type:

None

paused
process(event, identify_settings, rename_settings)[source]

Submit one current-session event for processing.

Parameters:
Return type:

None

reconciled
resume_writes(root)[source]

Resume worker catalog writes after a foreground job.

Parameters:

root (pathlib.Path)

Return type:

None

retry(event)[source]

Retry one current-session failed event.

Parameters:

event (adsfolio.pdf.watch_session.WatchEvent)

Return type:

None

session_id(root)[source]

Return the current session identifier for a root.

Parameters:

root (pathlib.Path)

Return type:

str | None

start_root(root, *, recursive)[source]

Start a fresh watch session for one root.

Parameters:
Return type:

str

started
staticMetaObject = PySide6.QtCore.QMetaObject("LibraryWatchController" inherits "QObject": Methods:   #4 type=Signal, signature=started(PyObject), parameters=PyObject   #5 type=Signal, signature=stopped(PyObject), parameters=PyObject   #6 type=Signal, signature=detected(PyObject), parameters=PyObject   #7 type=Signal, signature=outcome(PyObject), parameters=PyObject   #8 type=Signal, signature=failed(PyObject), parameters=PyObject   #9 type=Signal, signature=paused(PyObject), parameters=PyObject   #10 type=Signal, signature=reconciled(PyObject), parameters=PyObject   #11 type=Slot, signature=_on_started(PyObject), parameters=PyObject   #12 type=Slot, signature=_on_stopped(PyObject), parameters=PyObject   #13 type=Slot, signature=_forward_detected(PyObject), parameters=PyObject   #14 type=Slot, signature=_forward_outcome(PyObject), parameters=PyObject   #15 type=Slot, signature=_forward_reconciled(PyObject), parameters=PyObject   #16 type=Slot, signature=_forward_paused(PyObject), parameters=PyObject   #17 type=Slot, signature=_on_failed(PyObject), parameters=PyObject )
stop_all(*, wait_ms=5000)[source]

Stop all roots, retaining handles if any worker cannot stop.

Parameters:

wait_ms (int, optional) – Longest wait for each worker thread, in milliseconds. 0 asks every worker to stop and returns without a wait.

Returns:

True when every worker stopped.

Return type:

bool

stop_root(root, *, wait_ms=5000)[source]

Stop one root and wait for worker acknowledgement and thread finish.

Parameters:
  • root (Path) – Library root to stop.

  • wait_ms (int, optional) – Longest wait for the worker thread, in milliseconds. 0 only checks. The worker finishes its current PDF before it stops.

Returns:

True when the worker stopped and its resources are released. False keeps the handle, and a later call checks again.

Return type:

bool

stopped
class adsfolio.gui.watch.WatchFailure(root, session_id, message, event=None)[source]

Bases: object

Immutable failure emitted by a watch worker or controller.

Parameters:
event: adsfolio.pdf.watch_session.WatchEvent | None = None
message: str
root: pathlib.Path
session_id: str
class adsfolio.gui.watch._WorkerProtocol(*args, **kwargs)[source]

Bases: Protocol

detected: Any
failed: Any
outcome: Any
paused: Any
reconciled: Any
start()[source]
Return type:

None

started: Any
stop()[source]
Return type:

None

stopped: Any