Makeprojects
Loading...
Searching...
No Matches
makeprojects.validators.VSEnumProperty Class Reference

Enumeration integer value. More...

Public Member Functions

 __init__ (self, name, fallback, enumerations)
 Initialize the default value.
 set_value (self, value)
 Update with an index or an enumeration string.
 get_value (self)
 Return the string representation of the string, or None.
 __repr__ (self)
 Convert to string.
 __str__ (self)
 Convert to string.

Public Attributes

 name = name
 Name of the validator.
 default = fallback
 Default value of the validator.
str value = None
 Active value.
 enumerations = enumerations
 Enumeration alias list.

Detailed Description

Enumeration integer value.

Constructor & Destructor Documentation

◆ __init__()

makeprojects.validators.VSEnumProperty.__init__ ( self,
name,
fallback,
enumerations )

Initialize the default value.

Parameters
nameName of the validator
fallbackDefault value, None is acceptable
enumerationsList of enumeration alias tuples.

Member Function Documentation

◆ __repr__()

makeprojects.validators.VSEnumProperty.__repr__ ( self)

Convert to string.

Returns
Value as a string

◆ __str__()

makeprojects.validators.VSEnumProperty.__str__ ( self)

Convert to string.

Returns
Value as a string

◆ set_value()

makeprojects.validators.VSEnumProperty.set_value ( self,
value )

Update with an index or an enumeration string.

Value can be a number, a string or None to set to default.

Parameters
valueNone, number, or string.
Except
ValueError on input error