diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-10-24 21:30:51 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-11-02 12:45:11 -0400 |
commit | 6e0431907de4c551553ed527746bd684bdf2c78f (patch) | |
tree | bfb08f57f53343f1e9fc408eedcf3103fa80d914 | |
parent | 0382ffbf685b720204fb1c6f11517172870a366f (diff) | |
download | kutter-6e0431907de4c551553ed527746bd684bdf2c78f.tar.gz kutter-6e0431907de4c551553ed527746bd684bdf2c78f.tar.xz kutter-6e0431907de4c551553ed527746bd684bdf2c78f.zip |
gcode_macro: Remove support for deprecated features
Remove support for default_parameter_xxx config options. Remove
support for direct access to command parameters.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/extras/gcode_macro.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/klippy/extras/gcode_macro.py b/klippy/extras/gcode_macro.py index fffeed06..97584bdf 100644 --- a/klippy/extras/gcode_macro.py +++ b/klippy/extras/gcode_macro.py @@ -140,11 +140,6 @@ class GCodeMacro: name, self.cmd_SET_GCODE_VARIABLE, desc=self.cmd_SET_GCODE_VARIABLE_help) self.in_script = False - prefix = 'default_parameter_' - self.kwparams = {} - for option in config.get_prefix_options(prefix): - config.deprecate(option) - self.kwparams[option[len(prefix):].upper()] = config.get(option) self.variables = {} prefix = 'variable_' for option in config.get_prefix_options(prefix): @@ -171,9 +166,6 @@ class GCodeMacro: variable = gcmd.get('VARIABLE') value = gcmd.get('VALUE') if variable not in self.variables: - if variable in self.kwparams: - self.kwparams[variable] = value - return raise gcmd.error("Unknown gcode_macro variable '%s'" % (variable,)) try: literal = ast.literal_eval(value) @@ -183,12 +175,9 @@ class GCodeMacro: def cmd(self, gcmd): if self.in_script: raise gcmd.error("Macro %s called recursively" % (self.alias,)) - params = gcmd.get_command_parameters() - kwparams = dict(self.kwparams) - kwparams.update(params) - kwparams.update(self.variables) + kwparams = dict(self.variables) kwparams.update(self.template.create_template_context()) - kwparams['params'] = params + kwparams['params'] = gcmd.get_command_parameters() self.in_script = True try: self.template.run_gcode_from_command(kwparams) |