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:
parent
57eb0e8975
commit
ec34d78d5e
|
@ -34,6 +34,10 @@ class GetStatusWrapper:
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
def __iter__(self):
|
||||||
|
for name, obj in self.printer.lookup_objects():
|
||||||
|
if self.__contains__(name):
|
||||||
|
yield name
|
||||||
|
|
||||||
# Wrapper around a Jinja2 template
|
# Wrapper around a Jinja2 template
|
||||||
class TemplateWrapper:
|
class TemplateWrapper:
|
||||||
|
|
Loading…
Reference in New Issue