aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/gcode_macro.py
Commit message (Collapse)AuthorAgeFilesLines
* gcode_macro: implement "action_call_remote_method" context actionArksine2020-11-041-0/+8
| | | | | | Users may use this action to call methods registered by a webhooks client from a command template. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* gcode: Remove "action_" commands from get_status() callsKevin O'Connor2020-08-201-4/+19
| | | | | | | | | | | | Rename printer.gcode.action_emergency_stop() to action_emergency_stop(), printer.gcode.action_respond_info() to action_respond_info(), and printer.gcode.action_respond_error() to action_raise_error() in command templates. This simplifies the get_status() interface, as returning callable functions from that interface was confusing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Rename try_load_module() to load_object()Kevin O'Connor2020-05-081-1/+1
| | | | | | | | Rename try_load_module() so that it uses consistent naming for "printer objects". Change the function to raise an error by default if the specified module does not exist. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Use new GCodeCommand wrappersKevin O'Connor2020-05-051-7/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Create new wrapper class for gcode command parametersKevin O'Connor2020-05-051-3/+3
| | | | | | | | Instead of passing a dictionary to the command handlers, create a wrapper class and pass that class to the command handlers. This can simplify the command handler code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Support overriding of builtin g-code commandsKevin O'Connor2020-02-121-2/+23
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: add iterator to status wrapperJanar Sööt2019-07-011-0/+4
| | | | | | It really helps to see a snapshot of available printer variables when building menus and macros. The list of variables always depends on what printer config you have. Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* gcode_macro: Parse variable_X parameters using ast.literal_eval()Kevin O'Connor2019-06-071-4/+16
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Add a default parameter to load_templateKevin O'Connor2019-06-071-3/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Add support "x in printer" to templatesKevin O'Connor2019-06-041-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Add support for SET_GCODE_VARIABLE commandKevin O'Connor2019-06-041-1/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Rename "status" helper to "printer"Kevin O'Connor2019-06-041-5/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Evaluate macros using Jinja2 template engineKevin O'Connor2019-04-041-14/+79
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Raise a config error on invalid register_command()Kevin O'Connor2019-02-181-5/+1
| | | | | | | Raise a printer.config_error() on an invalid register_command() call. This error is easier to handle for the vast majority of callers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Provide more information on a formatting errorKevin O'Connor2018-09-301-3/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: default parameter valuesJanar Sööt2018-09-301-1/+7
| | | | | Signed-off-by: Janar Sööt <janar.soot@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: 2 lines wrapped at 80 charsJanar Sööt2018-09-261-2/+4
| | | | Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* gcode_macro: macro improvement with parametersJanar Sööt2018-09-261-1/+9
| | | | Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* gcode: Rename run_script() to run_script_from_command()Kevin O'Connor2018-06-301-1/+1
| | | | | | | Emphasize that the run_script() method is only valid when run from a g-code command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Add the ability to define custom g-code macrosKevin O'Connor2018-05-251-0/+29
Add the ability to add a custom g-code command that in turn executes one or more configured g-code commands. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>