gcode_macro: 2 lines wrapped at 80 chars

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
This commit is contained in:
Janar Sööt 2018-09-26 08:23:45 +03:00 committed by KevinOConnor
parent 51d64ad7f8
commit d22b30342a
1 changed files with 4 additions and 2 deletions

View File

@ -12,14 +12,16 @@ class GCodeMacro:
printer = config.get_printer()
self.gcode = printer.lookup_object('gcode')
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:
raise config.error(str(e))
self.in_script = False
cmd_desc = "G-Code macro"
def cmd(self, params):
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 = ""
try:
script = self.script.format(**params)