Skip to content

fontlab_instamix.extension · declarations 001

Back to fontlab_instamix.extension

EXT module-attribute

EXT

JUNK module-attribute

JUNK

LIBRARY module-attribute

LIBRARY

ZIP module-attribute

ZIP

basename

basename(path: Path | str) -> str

Folder name without .fontlabext (the {} placeholder).

check_member

check_member(name: str) -> None

Reject zip member names that could write outside the target folder.

default_copy

default_copy() -> bool

Copy instead of symlinking on Windows.

generated_entries

generated_entries(data: Path, paths: list[Path]) -> list[dict]

Ledger entries for files and folders that instamix wrote itself.

hook_for

hook_for(folder: Path) -> Path | None

Optional installer hook next to an unpacked extension.

inside

inside(data: Path, path: Path) -> bool

True if path lies inside data; the last part is not followed.

install

install(path: Path, data: Path | None = None, *, copy: bool | None = None, run_hooks: bool = False, requirements=None, target: Target | None = None) -> list[dict]

Install an extension folder, its manifest, or all folders in an archive.

Archive failures retain the original exception and attach installed_records for the extensions already committed before the failure.

install_folder

install_folder(folder: Path, data: Path, *, copy: bool | None = None, requirements=None, target: Target | None = None, editable: bool = False, generated: list[tuple[Path, Path]] | None = None, fields: dict | None = None) -> dict

Install one unpacked .fontlabext folder; return its ledger record.

generated supplies prebuilt (source, target) file pairs copied into the same transaction. fields adds keys to the ledger record.

requirements is called as requirements(data, list_of_specs) when the manifest lists python.requires (packages.install by default). editable links files straight to their real (symlink-resolved) sources, e.g. a project checkout, and keeps only the manifest in Library.

installed

installed(data: Path | None = None) -> list[dict]

is_ext

is_ext(path: Path | str) -> bool

is_zip

is_zip(path: Path | str) -> bool

library_path

library_path(data: Path, ext_id: str) -> Path

plan

plan(folder: Path, info: Manifest, name: str, data: Path, *, version: str | None = None) -> list[tuple[Path, Path]]

Return (source, target) pairs for every file the manifest installs.

preflight_plugin_migration

preflight_plugin_migration(data: Path, pairs: list[tuple[Path, Path]], previous: dict | None) -> None

Refuse distinct legacy bundles that removal would retain before any writes.

remove_entries

remove_entries(data: Path, entries: list[dict]) -> list[str]

Remove recorded paths that are still ours; return the ones left behind.

restore_entries

restore_entries(data: Path, entries: list[dict]) -> None

Re-create entries removed by :func:_remove_tracked (rollback).

sources

sources(folder: Path, pattern: str) -> list[tuple[Path, str]]

Files matched by a from pattern, with their path below the match root.

A folder contributes all its files (its contents go into the destination); a file or glob contributes the files themselves.

stage

stage(folder: Path, target: Path, data: Path) -> None

Copy folder to target, replacing an older copy at the last moment.

uninstall

uninstall(ext_id: str, data: Path | None = None) -> list[str]

Uninstall ext_id; return paths left in place because they changed.

uninstall_links(data: Path, record: dict) -> list[str]

unpack

unpack(zip_path: Path, into: Path) -> list[Path]

Extract a .fontlabextz into into; return its .fontlabext folders.