Module enum_helper

uno Enum Helper Methods

These methods are used to add custom functionality to enums or enum like classes.

ooodev.utils.enum_helper.uno_enum_class_ne(self, other)[source]

Enum Not equal method.

This method is usually assigned to an enum.

Parameters:

other (object) – Object to compare

Returns:

False if equal; Otherwise, true

Return type:

bool

ooodev.utils.enum_helper.uno_enum_class_new(cls, value)[source]

New (__new__) method for dynamically created uno.Enum classes

Parameters:

value (object) – Can be uno.Enum, uno.Enum.value, str

Raises:

ValueError – if unable to match enum instance

Returns:

Enum Instance

Return type:

[uno.Enum]

Example

>>> e = HorizontalAlignment("RIGHT")
>>> print(e.value)
RIGHT
>>> e = HorizontalAlignment(HorizontalAlignment.LEFT)
>>> print(e.value)
LEFT
>>> e = HorizontalAlignment(HorizontalAlignment.CENTER.value)
>>> print(e.value)
CENTER