-
Notifications
You must be signed in to change notification settings - Fork 0
/
MACROS.cfg
21 lines (18 loc) · 988 Bytes
/
MACROS.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[gcode_macro DUMP_VARIABLES]
gcode:
{% set filter_name = params.NAME|default('')|string|lower %}
{% set filter_value = params.VALUE|default('')|string|lower %}
{% set show_cfg = params.SHOW_CFG|default(0)|int %}
{% set out = [] %}
{% for key1 in printer %}
{% for key2 in printer[key1] %}
{% if (show_cfg or not (key1|lower == 'configfile' and key2|lower in ['config', 'settings'])) and (filter_name in key1|lower or filter_name in key2|lower) and filter_value in printer[key1][key2]|string|lower %}
{% set dummy = out.append("printer['%s'].%s = %s" % (key1, key2, printer[key1][key2])) %}
{% endif %}
{% else %}
{% if filter_name in key1|lower and filter_value in printer[key1]|string|lower %}
{% set dummy = out.append("printer['%s'] = %s" % (key1, printer[key1])) %}
{% endif %}
{% endfor %}
{% endfor %}
{action_respond_info(out|join("\n"))}