FgdEntityProperty¶
-
class
fgdtools.
FgdEntityProperty
(name, value_type, readonly=False, display_name=None, default_value=None, description=None, choices=[])[source]¶ An entity property, as represented in a Fgd file.
-
__init__
(name, value_type, readonly=False, display_name=None, default_value=None, description=None, choices=[])[source]¶ Creates an instance of FgdEntityProperty.
- Parameters
name (bool, optional) – The property’s name.
value_type (str) – The property’s value type. Ex:’integer’, ‘float’, ‘choices’, etc…
name – The property’s readonly status.
display_name (str, optional) – The property’s display name.
default_value (str, optional) – The property’s unparsed default value.
description (str, optional) – The property’s description.
choices (list[FgdEntityPropertyChoice], optional) – The property’s choices. (applicable only to value_type “choices”)
-
__repr__
()[source]¶ A partial, printable summary of a FgdEntityProperty.
- Returns
A Python formated string.
- Return type
-
property
schema
¶ A schematic view of this entity property’s attributes.
- Returns
A dictionary
- Return type
-
property
choices
¶ The property’s choices.
- Return type
-
choice_by_value
(choice_value)[source]¶ Finds a property choice by its value
- Parameters
choice_value (int) – The property choice value to look for.
- Raises
ChoiceNotFound – Whenever a property choice could not be found.
- Returns
A property choice with matching value.
- Return type
-