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

Value can only be true or false. More...

Public Member Functions

 __init__ (self, name, fallback=None)
 Initialize the default value.
 get_value (self)
 Return the string representation of the string, or None.
 __repr__ (self)
 Convert to string.
 __str__ (self)
 Convert to string.

Static Public Member Functions

 validate (key, configuration, fallback=None, options_key=None, options=None)
 Check if there is a command line switch override.
 vs_validate (key, configuration, fallback=None, options_key=None, options=None, prefix=None)
 Check if there is an override with a vs_ prefix.

Public Attributes

 name = name
 Name of the validator.

Static Public Attributes

 value = BooleanProperty("_value")
 BooleanProperty boolean value.

Detailed Description

Value can only be true or false.

Constructor & Destructor Documentation

◆ __init__()

makeprojects.validators.VSBooleanProperty.__init__ ( self,
name,
fallback = None )

Initialize the default value.

Parameters
nameName of the validator
fallbackDefault value, None is acceptable

Member Function Documentation

◆ __repr__()

makeprojects.validators.VSBooleanProperty.__repr__ ( self)

Convert to string.

Returns
"true", "false" or "None"

◆ __str__()

makeprojects.validators.VSBooleanProperty.__str__ ( self)

Convert to string.

Returns
"true", "false" or "None"

◆ validate()

makeprojects.validators.VSBooleanProperty.validate ( key,
configuration,
fallback = None,
options_key = None,
options = None )
static

Check if there is a command line switch override.

Given a configuration, scan for the options_key and if found, check if that list has one of the option tuples. If there's a match, use the options tuple entry, otherwise use the fallback value.

Parameters
keyName of the XML attribute key
configurationconfiguration to scan for an override
fallbackValue to use in case there is no override.
options_keyAttribute to scan for commmand line options
optionsIterable with options / Value pairs
Returns
None or VSBooleanProperty instance

◆ vs_validate()

makeprojects.validators.VSBooleanProperty.vs_validate ( key,
configuration,
fallback = None,
options_key = None,
options = None,
prefix = None )
static

Check if there is an override with a vs_ prefix.

Check if the configuration has a key of "vs_" + prefix + key in the configuration and if not found or None, use the key as is.

Parameters
keyName of the XML attribute key
configurationconfiguration to scan for an override
fallbackValue to use in case there is no override.
options_keyAttribute to scan for commmand line options
optionsIterable with options / Value pairs
prefixString to insert after "vs_"
Returns
None or VSBooleanProperty instance