From 05cd9a6d340ac2329125bd404301673a3b64a0f0 Mon Sep 17 00:00:00 2001 From: alfrix Date: Sun, 7 Jan 2024 17:27:43 -0300 Subject: [PATCH] remove fallback values with an empty string re will not match --- docs/Installation.md | 1 + panels/extrude.py | 4 ++-- panels/fine_tune.py | 2 +- panels/move.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/Installation.md b/docs/Installation.md index 54dd24f0..d2239739 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -51,6 +51,7 @@ If you need a custom location for the configuration file, you can add -c or --co the location of your configuration file. At this point KlipperScreen should be working, if it doesn't start then go to the [troubleshooting page](Troubleshooting.md) +!!! warning ## Moonraker configuration diff --git a/panels/extrude.py b/panels/extrude.py index 7d4825c3..9bf03e11 100644 --- a/panels/extrude.py +++ b/panels/extrude.py @@ -20,12 +20,12 @@ class Panel(ScreenPanel): self.speeds = ['1', '2', '5', '25'] self.distances = ['5', '10', '15', '25'] if self.ks_printer_cfg is not None: - dis = self.ks_printer_cfg.get("extrude_distances", '5, 10, 15, 25') + dis = self.ks_printer_cfg.get("extrude_distances", '') if re.match(r'^[0-9,\s]+$', dis): dis = [str(i.strip()) for i in dis.split(',')] if 1 < len(dis) < 5: self.distances = dis - vel = self.ks_printer_cfg.get("extrude_speeds", '1, 2, 5, 25') + vel = self.ks_printer_cfg.get("extrude_speeds", '') if re.match(r'^[0-9,\s]+$', vel): vel = [str(i.strip()) for i in vel.split(',')] if 1 < len(vel) < 5: diff --git a/panels/fine_tune.py b/panels/fine_tune.py index d198637c..34cbbd1e 100644 --- a/panels/fine_tune.py +++ b/panels/fine_tune.py @@ -21,7 +21,7 @@ class Panel(ScreenPanel): def __init__(self, screen, title): super().__init__(screen, title) if self.ks_printer_cfg is not None: - bs = self.ks_printer_cfg.get("z_babystep_values", "0.01, 0.05") + bs = self.ks_printer_cfg.get("z_babystep_values", "") if re.match(r'^[0-9,\.\s]+$', bs): bs = [str(i.strip()) for i in bs.split(',')] if 1 < len(bs) < 3: diff --git a/panels/move.py b/panels/move.py index 8a2e4859..a4f1b788 100644 --- a/panels/move.py +++ b/panels/move.py @@ -16,7 +16,7 @@ class Panel(ScreenPanel): super().__init__(screen, title) if self.ks_printer_cfg is not None: - dis = self.ks_printer_cfg.get("move_distances", '0.1, 0.5, 1, 50, 10, 25, 50') + dis = self.ks_printer_cfg.get("move_distances", '') if re.match(r'^[0-9,\.\s]+$', dis): dis = [str(i.strip()) for i in dis.split(',')] if 1 < len(dis) <= 7: