gcode_macro: add iterator to status wrapper

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>
This commit is contained in:
Janar Sööt authored and KevinOConnor committed 2019-07-01 10:59:13 -04:00
1 parent 57eb0e8975
commit ec34d78d5e
1 file changed
+4
+4
View File
@@ -34,6 +34,10 @@ class GetStatusWrapper:
except KeyError as e:
return False
return True
def __iter__(self):
for name, obj in self.printer.lookup_objects():
if self.__contains__(name):
yield name
# Wrapper around a Jinja2 template
class TemplateWrapper: