From 2461b30a6a6d1dc007f1c4f608820a303dc57ebb Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 19 Aug 2021 15:12:31 -0400 Subject: [PATCH] quad_gantry_level: Use config.getlists() for gantry_corners config option Signed-off-by: Kevin O'Connor --- klippy/extras/quad_gantry_level.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/klippy/extras/quad_gantry_level.py b/klippy/extras/quad_gantry_level.py index 8b10918f..7c6febcb 100644 --- a/klippy/extras/quad_gantry_level.py +++ b/klippy/extras/quad_gantry_level.py @@ -35,15 +35,8 @@ class QuadGantryLevel: "Need exactly 4 probe points for quad_gantry_level") self.z_status = z_tilt.ZAdjustStatus(self.printer) self.z_helper = z_tilt.ZAdjustHelper(config, 4) - gantry_corners = config.get('gantry_corners').split('\n') - try: - gantry_corners = [line.split(',', 1) - for line in gantry_corners if line.strip()] - self.gantry_corners = [(float(zp[0].strip()), float(zp[1].strip())) - for zp in gantry_corners] - except: - raise config.error("Unable to parse gantry_corners in %s" % ( - config.get_name())) + self.gantry_corners = config.getlists('gantry_corners', parser=float, + seps=(',', '\n'), count=2) if len(self.gantry_corners) < 2: raise config.error( "quad_gantry_level requires at least two gantry_corners")