Parser configuration files

class Parser.AttributeTypes.AttributeType(*args, **kwargs)[source]

Holds basic common information and provides common interfaces for an attribute type definition. Specific keys are defined in the specialized attribute types.

The following keys can be handled by every type of attribute:

Required
Optional
class Parser.AttributeTypes.StringType(*args, **kwargs)[source]

String type attribute:

Used if type was set to string

Holds all information necessary for a string attribute type definition.

Will be rendered in the UI as a text input field.

Supports the following additional keys:

Optional
  • validation takes a regular expression as value and uses it to validate any input.

class Parser.AttributeTypes.BoolType(*args, **kwargs)[source]

Boolean type attribute:

Used if type was set to bool

Can be either true or false.

Will be rendered in the UI as a checkbox.

class Parser.AttributeTypes.IntType(*args, **kwargs)[source]

Integer type attribute:

Used if type was set to int

Can store an integer value.

Will be rendered in the UI as a spinner which will only accept integer values.

Supports the following additional keys:

Optional
  • min constraints the input value to not be lower than the provided value.

  • max constraints the input value to not be higher than the provided value.

  • |UNIT_KEY| shows a prefix in the UI spinner element.

class Parser.AttributeTypes.FloatType(*args, **kwargs)[source]

Float type attribute:

Used if type was set to float

Can store a float value.

Will be rendered in the UI as a spinner which will accept float values.

Supports the following additional keys:

Optional
  • min constraints the input value to not be lower than the provided value.

  • max constraints the input value to not be higher than the provided value.

  • |UNIT_KEY| shows a prefix in the UI spinner element.

class Parser.AttributeTypes.HexType(*args, **kwargs)[source]

Hex type attribute:

Used if type was set to hex

Can store an integer value.

Will be rendered in the UI as a special kind of spinner which will show a 0x prefix and allows selecting hex values.

Supports the following additional keys:

Optional
  • min constraints the input value to not be lower than the provided value.

  • max constraints the input value to not be higher than the provided value.

  • alignment constraints the input value to be aligned to the provided value in the form of \({alignmentValue}^{inputValue}\).

class Parser.AttributeTypes.ReferenceListType(*args, **kwargs)[source]

Reference list type attribute:

Used if type was set to reference_list

The values of attribute instances created using this type will be a list of references to the entities which are defined in the config file by using a link.

Will be rendered in the UI as a list builder which will allow to select multiple specific entities.

Supports the following additional keys:

OPTIONAL
  • elements constraints the options to choose from to be the ones defined in this property.

class Parser.AttributeTypes.StringListType(*args, **kwargs)[source]

String list type attribute:

Used if type was set to string_list

The values of attribute instances created using this type will be a list of strings.

Will be rendered in the UI as a list builder which will allow to add or remove arbitrary strings.

class Parser.AttributeTypes.SelectionType(*args, **kwargs)[source]

Selection type attribute:

Used if type was set to selection

The values of attribute instances created using this type will be the value of the selected option.

Will be rendered in the UI as a combo box which will allow to select one of the options defined in the elements property.

Supports the following additional keys:

Required
  • elements constraints the options to choose from to be the ones defined in this property.
    type

    list[str] or str

    behaviour

    If a list of strings, every list entry will show up as an option as is. If a string, the string will be interpreted as a link.

class Parser.AttributeTypes.SliderType(*args, **kwargs)[source]

Slider type attribute:

Used if type was set to slider

Can store a float or int value depending on the type of the step property.

For now rendering this item in the UI is not implemented yet.

Supports the following additional keys:

Optional
  • min constraints the input value to not be lower than the provided value.

  • max constraints the input value to not be higher than the provided value.

  • step defines the step size for the slider.

class Parser.AttributeTypes.ParentReferenceType(*args, **kwargs)[source]

Reference list type attribute:

Used if type was set to parent_reference

Will create a link between the attribute and the referenced entity. The link created will go both ways. This means that in the entity referenced by this attribute will get a reference to this attribute and vice versa.

Will be rendered in the UI as a placeholder text for now because relinking these elements is not yet supported.