Class
PlaceHolder
SVG placeholder base class.
- edit Alexis BRENON brenon.alexis+arcades@gmail.com
Fields
keyboard_arrow_up-
table
placed_values
List of values to used to format string to build string_value.
-
string
sensor_id
Identifier of the sensor represented by this PlaceHolder.
-
string
string
String representation template.
-
string
string_value
String representation of the current value.
-
value
Current value of the PlaceHolder.
Metamethods
keyboard_arrow_up-
__init ( element, spec )
Placeholder constructor.
Parameters:-
Doc
element
XML element to parse -
table
spec
PlaceHolder's specification extracted from SVG description
-
Doc
-
__tostring__ ()
Return the string representation of the PlaceHolder.
If available, just return the current string representation or build and save it if necessary.
Returns:
Abstract Methods
keyboard_arrow_up-
_prepare_string ( _ )
Initialize string and placed_values from given XML element.
Parameters:-
Doc
_
XML element
-
Doc
-
get_random_value ()
Get a random value from the PlaceHolder.
The value is sampled from the range of acceptable values for this kind of PlaceHolder.
-
set_value ()
Change current value of the PlaceHolder.
Static Functions
keyboard_arrow_up-
dump_attribs ( e[, except={}] )
Dump attributes of an XML element.
Use this function to retrieve attributes of an element if you need to build a new one with same attributes. You can leave out some of them passing a map indexed with names of attributes to dismiss.
Parameters:-
Doc
e
XML element -
{[string]=boolean}
except
Set of attributes to dismiss (default{}
)
- string Suitable string to append to an XML string
-
Doc