Wp.SettingsSpec

Fields

None

Methods

check_value (value)

get_default_value ()

get_description ()

get_max_value ()

get_min_value ()

get_value_type ()

ref ()

unref ()

Details

class Wp.SettingsSpec

WpSettingSpec holds the specification of a setting.

check_value(value)
Parameters:

value (Wp.SpaJson) – the value to check

Returns:

True if the value is compatible with the spec, False otherwise

Return type:

bool

Checks whether a value is compatible with the spec or not.

get_default_value()
Returns:

the default value of the settings spec

Return type:

Wp.SpaJson

Gets the default value of a settings spec.

get_description()
Returns:

the description of the settings spec

Return type:

str

Gets the description of a settings spec.

get_max_value()
Returns:

the maximum value of the settings spec, or None if the spec type is not Wp.SettingsSpecType.INT or Wp.SettingsSpecType.FLOAT

Return type:

Wp.SpaJson or None

Gets the maximum value of a settings spec.

get_min_value()
Returns:

the minimum value of the settings spec, or None if the spec type is not Wp.SettingsSpecType.INT or Wp.SettingsSpecType.FLOAT

Return type:

Wp.SpaJson or None

Gets the minimum value of a settings spec.

get_value_type()
Returns:

the type of the settings spec

Return type:

Wp.SettingsSpecType

Gets the type of a settings spec.

ref()
Returns:

self with an additional reference count on it

Return type:

Wp.SettingsSpec

Increases the reference count of a settings spec object.

unref()

Decreases the reference count on self and frees it when the ref count reaches zero.