paraphernalia.review module

Review a source directory (and its subdirectories) of images, and “keep” or “lose” them by moving them to another parent directory.

The defaults are “keep” and “lose” off the parent of source. Directory structure is preserved, and directories are created as needed.

Functionality is split between a front-end ReviewApp and back-end Review.

TODO:

  • Move fully processed directories to lose

  • Notebook mode?

  • Add filename filtering

class ReviewApp(review, fullscreen=True)[source]

Barebones GL-based review application.

Parameters
  • review (Review) – the review instance (see below)

  • fullscreen (bool, optional) – if True start in full screen mode. Defaults to True.

run()[source]

Main event loop.

Blocking.

load()[source]

Load and display the specified image.

render()[source]

Render callback.

key_event(key, action, modifiers)[source]

Key handler.

class Review(source_path, keep_path=None, lose_path=None, dryrun=False)[source]

Core review logic that could potentially be shared across different front-ends.

Parameters
  • source_path (str) –

  • keep_path (str) –

  • lose_path (str) –

  • dryrun (bool) –

property path: pathlib.Path

The current path to review.

property verdict

The verdict on the current path.

scan(direction, verdict=None)[source]

Scan to the next item matching verdict (None matches any)

Parameters
  • direction (int) – 1 for forward, -1 for backward

  • verdict (Optional[int], optional) – Status to match. Defaults to None which matches everything.

next(verdict=None)[source]

Switch to next object in the sequence, subject to the filters.

previous(verdict=None)[source]

Switch to previous object in the sequence, subject to the filters.

clear()[source]

Clear the verdict on the current object.

keep()[source]

Mark the current object to be kept.

lose()[source]

Mark the current object to be removed.

property progress
commit()[source]

Move any empty source directories to lose.