fontlabapp.core.menu_names · declarations 001
Back to fontlabapp.core.menu_names
assign_names
assign_names(entries: Sequence[tuple[str, str, bool]], reserved: Iterable[str] = ()) -> list[str]
Unique sibling names for (label, objectName, visible) entries.
Names follow action identity, never visibility or menu position: among
siblings whose labels give the same name, the one whose objectName slug
is that name keeps it, else the smallest objectName, else the first
entry without one. The others take their objectName slug, or a numbered
suffix when that is empty or taken. Reserved names (the node's own API)
get a trailing underscore. visible is accepted for callers but unused.
clean_label
clean_label(text: str) -> str
Human label: drop shortcut suffix, mnemonic & (&& is &), ellipsis.
object_slug
object_slug(object_name: str) -> str
snake_case of a Qt objectName without its action/menu prefix.
snake
snake(label: str) -> str
snake_case identifier for a menu label; & reads as and.