ProjectAttrSpec

class ProjectAttrSpec

object related to project attribute definitions, persisted in .workspace/prjattr.spec.

Returned by

AddAttributeDef(attributeDef)

Adds an attribute definition to the spec.

Parameters:
attributeDef

Attribute definition to add (AttributeDef or ChoiceAttributeDef)

Raises:

ApiError – If attributeDef type is invalid, identifier is invalid or identifier is duplicated.

DeleteAttribute(identifier)

Deletes the attribute definition with the given identifier.

Parameters:
identifier : str

Identifier of the definition to delete

Raises:

ApiError – If identifier has invalid type or is empty.

DeleteAttributesByGroup(groupName)

Deletes all attributes from the given group name (case-insensitive).

Parameters:
groupName : str

Group name to delete

Raises:

ApiError – If groupName has invalid type.

GetAttributeDefs()

Returns all attribute definitions from the currently loaded attribute spec state.

Choice definitions are returned as ChoiceAttributeDef, all other definitions as AttributeDef.

Returns:

Attribute definition objects from the currently loaded spec state

Return type:

list[AttributeDef]

Save()

Saves and reloads the spec file.

Raises:

ApiError – If saving or reloading the attribute spec fails.