remove fallback values

with an empty string re will not match
This commit is contained in:
alfrix committed 2024-01-07 17:27:59 -03:00
1 parent 2527a12d32
commit 05cd9a6d34
4 files changed
+5 -4

No files matched your search

+1
View File
@@ -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
+2 -2
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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: