delta_calibrate: Use config.getfloatlist() for parsing "stable positions"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -14,14 +14,7 @@ from . import probe
|
|||||||
|
|
||||||
# Load a stable position from a config entry
|
# Load a stable position from a config entry
|
||||||
def load_config_stable(config, option):
|
def load_config_stable(config, option):
|
||||||
spos = config.get(option)
|
return config.getfloatlist(option, count=3)
|
||||||
try:
|
|
||||||
sa, sb, sc = map(float, spos.split(','))
|
|
||||||
except:
|
|
||||||
msg = "Unable to parse stable position '%s'" % (spos,)
|
|
||||||
logging.exception(msg)
|
|
||||||
raise config.error(msg)
|
|
||||||
return sa, sb, sc
|
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user