diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-05-20 13:04:52 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-05-20 13:08:22 -0400 |
commit | 33c2c8f1bdca48eda4d00b8c5a98a3ba9f9e6644 (patch) | |
tree | 6a4d5e32f81767b666d4ff5078d0de4deb202b99 /klippy/gcode.py | |
parent | 2ab47cd20c87aa6798f13e0f5180cb90c9cba614 (diff) | |
download | kutter-33c2c8f1bdca48eda4d00b8c5a98a3ba9f9e6644.tar.gz kutter-33c2c8f1bdca48eda4d00b8c5a98a3ba9f9e6644.tar.xz kutter-33c2c8f1bdca48eda4d00b8c5a98a3ba9f9e6644.zip |
gcode: Raise an error if a duplicate command is registered
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r-- | klippy/gcode.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index d381620d..6cee4570 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -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)) |