Skip to content

PropertyGroup

PropertyGroup dataclass

PropertyGroup(match_name: str, name: str, enabled: bool | None = None, is_effect: bool = False, properties: list[Property] = list())

Bases: PropertyBase

Group of properties.

Attributes:

Name Type Description
is_effect bool

When true, this property is an effect PropertyGroup.

elided

elided() -> bool

Return True if this property group is elided (not an effect).

Source code in src/aep_parser/models/properties/property_group.py
@property
def elided(self) -> bool:
    """Return True if this property group is elided (not an effect)."""
    return not self.is_effect

__iter__

__iter__() -> Iterator[Property]

Return an iterator over the properties in this group.

Source code in src/aep_parser/models/properties/property_group.py
def __iter__(self) -> typing.Iterator[Property]:
    """Return an iterator over the properties in this group."""
    return iter(self.properties)

get_property

get_property(index: int | None = None, name: str | None = None) -> Property | None

Find and return a child property of this group.

The property can be specified by either its index or name (match name or display name).

Parameters:

Name Type Description Default
index int | None

The index of the property to return.

None
name str | None

The name of the property to return.

None
Source code in src/aep_parser/models/properties/property_group.py
def get_property(
    self, index: int | None = None, name: str | None = None
) -> Property | None:
    """
    Find and return a child property of this group.

    The property can be specified by either its index or name (match name
    or display name).

    Args:
        index: The index of the property to return.
        name: The name of the property to return.
    """
    defined_arg = index or name
    if defined_arg:
        if isinstance(defined_arg, (int, float)):
            return self.properties[defined_arg]
        elif isinstance(defined_arg, str):
            for prop in self.properties:
                if prop.name == defined_arg or prop.match_name == defined_arg:
                    return prop
    return None