This documentation is for an unreleased version of MPF!
This is the developer documentation for MPF 0.50, which is the “dev” (next) release of MPF that is a work-in-progress. Use the “Read the Docs” link in the lower left corner to view the developer docs for the version of MPF you’re using.
MPF’s divergence for pure YAML¶
MPF uses the YAML file format for config and show files. That said, MPF diverges from the pure YAML 1.2 specification for unquoted strings in a few ways. Those are cases where YAML guesses which data type the value is which led to problems/confusion in the past:
Values beginning with “+” are strings
The YAML spec essentially ignores a leading plus sign, so a value
+1would be read in as the integer
1. However MPF needs to differentiate between
1since the plus sign is used to mean the value is a delta in certain situations, so MPF’s YAML interfaces will process any numeric values with a leading plus sign as strings.
Values beginning with a leading “0” are strings
The YAML spec will process values that are only digits 0-7 with leading zeros as octals. However MPF could have color values like
050505which should be read as strings. So the MPF YAML interface processes any value with at least 3 digits and leading zeros as strings.
“On” and “Off” values are strings
The YAML spec defines
offvalues as bools. But many MPF users create show names called “on” and “off”, so MPF’s YAML processor interprets those as strings. (True, False, Yes, and No are still processes as bools.)
Values with only digits and “e” are strings
The YAML spec will process a value like
123e45as “123 exponent 45”. Since those could be hex color codes, MPF’s YAML interface processes values that are all digits with a single “e” character as strings.