mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-08 07:27:43 -06:00
gcode: Raise an error if a duplicate command is registered
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
2ab47cd20c
commit
33c2c8f1bd
3 changed files with 4 additions and 0 deletions
|
@ -62,6 +62,8 @@ class GCodeParser:
|
|||
if cmd in self.base_gcode_handlers:
|
||||
del self.base_gcode_handlers[cmd]
|
||||
return
|
||||
if cmd in self.ready_gcode_handlers:
|
||||
raise error("gcode command %s already registered" % (cmd,))
|
||||
if not (len(cmd) >= 2 and not cmd[0].isupper() and cmd[1].isdigit()):
|
||||
origfunc = func
|
||||
func = lambda params: origfunc(self.get_extended_params(params))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue