mirror of https://github.com/Desuuuu/klipper.git
gcode_macro: 2 lines wrapped at 80 chars
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
This commit is contained in:
parent
51d64ad7f8
commit
d22b30342a
|
@ -12,14 +12,16 @@ class GCodeMacro:
|
||||||
printer = config.get_printer()
|
printer = config.get_printer()
|
||||||
self.gcode = printer.lookup_object('gcode')
|
self.gcode = printer.lookup_object('gcode')
|
||||||
try:
|
try:
|
||||||
self.gcode.register_command(self.alias, self.cmd, desc=self.cmd_desc)
|
self.gcode.register_command(
|
||||||
|
self.alias, self.cmd, desc=self.cmd_desc)
|
||||||
except self.gcode.error as e:
|
except self.gcode.error as e:
|
||||||
raise config.error(str(e))
|
raise config.error(str(e))
|
||||||
self.in_script = False
|
self.in_script = False
|
||||||
cmd_desc = "G-Code macro"
|
cmd_desc = "G-Code macro"
|
||||||
def cmd(self, params):
|
def cmd(self, params):
|
||||||
if self.in_script:
|
if self.in_script:
|
||||||
raise self.gcode.error("Macro %s called recursively" % (self.alias,))
|
raise self.gcode.error(
|
||||||
|
"Macro %s called recursively" % (self.alias,))
|
||||||
script = ""
|
script = ""
|
||||||
try:
|
try:
|
||||||
script = self.script.format(**params)
|
script = self.script.format(**params)
|
||||||
|
|
Loading…
Reference in New Issue