Expand description
.eaglepack export and import.
An .eaglepack is a zip archive with no compression (Eagle’s archiver
runs with store: true). At its root is pack.json,
{"images": [...], "folder": {...}}, followed by each item’s whole
<ID>.info/ folder. images holds the item records (their
metadata.json contents), newest modificationTime first; folder is
present only when a folder was exported and carries its subtree. On
import every item and folder gets a new id, so a pack can be imported
into the library it came from.
Structs§
- Pack
Import - An import in steps, so a caller can lock the library per item, show
progress and stop between items:
PackImport::prepare, thenPackImport::start, thenPackImport::stepuntil it returnsNone.import_packruns all of it at once. - Pack
Import Options - Settings for
import_pack. - Pack
Plan - A pack worked out but not yet written (see
plan_pack). It holds no reference to the library, so it can be written on another thread. - Pack
Preview - What importing a pack would do, read before asking (Eagle confirms the disk space first, then asks about items it already has).
Enums§
- Pack
Source - What to put in a pack.
Functions§
- export_
pack - Writes an
.eaglepackofsourcetodestand returns the number of items in it. The archive is checked after writing and removed if it can’t be read back. - extract_
pack - Unpacks
packinto a temporary folder, the slow, library-free part of an import (an app can do it without holding the library). - import_
pack - Imports the pack at
packintoliband returns the new item ids. Items and folders get new ids; a folder pack’s tree is added at the root. - plan_
pack - Works out the contents of a pack of
source: thepack.jsonand the item folders to add. - preview_
pack - Reads
pack.jsonand the archive’s sizes without extracting anything. - write_
pack - Writes a planned pack to
dest, callingon_itemwith the number of item folders added so far, and returns the number of items. The archive is written besidedest, checked and only then moved into place. - write_
pack_ until - Like
write_pack, buton_itemreturns whether to go on. Returning false stops after that item: nothing is left atdest(the archive is built in a temporary file that is removed) and the result isNone.