gcode_macro: Disallow whitespace in macro name (#4312)

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
This commit is contained in:
Florian Heilmann authored and GitHub committed 2021-05-26 13:03:10 -04:00
1 parent bd42d497ae
commit ba3bbca861
1 file changed
+4
+4
View File
@@ -113,6 +113,10 @@ def load_config(config):
class GCodeMacro:
def __init__(self, config):
if len(config.get_name().split()) > 2:
raise config.error(
"Name of section '%s' contains illegal whitespace"
% (config.get_name()))
name = config.get_name().split()[1]
self.alias = name.upper()
self.printer = printer = config.get_printer()