Skip to main content

Module smart

Module smart 

Source
Expand description

Smart folders: saved rule sets in the library metadata.json (see the Smart folders chapter of the docs). Entries stay raw JSON in LibraryMetadata so they round-trip untouched; this module reads, evaluates and edits them.

Structs§

Context
What evaluating rules needs besides the item: the folder index (for folderName), the activated fonts (for fontActivated, read on first use from Eagle’s font folder and falcon’s) and a cache of compiled regexes.
SmartFolder
A smart folder, read from its JSON entry.

Functions§

contains
Whether a live item is in a smart folder: it must pass the folder’s conditions and every ancestor’s. A folder without conditions shows the union of its children (nothing if it has none), as Eagle’s view does.
count_draft
How many live items a smart folder with conditions would show inside parent (its ancestors’ conditions apply too), for the dialog’s live count while the rules are edited, as Eagle’s dialog counts them. Empty conditions count nothing, as a group with no children shows nothing.