CAM: Fix postprocessors Help arguments --postamble and --preamble (#20792)

This commit is contained in:
tarman3
2025-04-16 12:54:04 +03:00
committed by GitHub
parent 989a06ea63
commit d84d9c9bd1
17 changed files with 86 additions and 86 deletions

View File

@@ -56,11 +56,11 @@ parser.add_argument(
parser.add_argument("--precision", default="3", help="number of digits of precision, default=3")
parser.add_argument(
"--preamble",
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90"',
help='set commands to be issued before the first command, default="G17 G54 G40 G49 G80 G90\\n"',
)
parser.add_argument(
"--postamble",
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM2"',
help='set commands to be issued after the last command, default="M05\\nG17 G54 G90 G80 G40\\nM2\\n"',
)
parser.add_argument(
"--inches", action="store_true", help="Convert output for US imperial mode (G20)"
@@ -196,7 +196,7 @@ def export(objectslist, filename, argstring):
# Write the preamble
if OUTPUT_COMMENTS:
gcode += linenumber() + "(begin preamble)\n"
for line in PREAMBLE.splitlines(False):
for line in PREAMBLE.splitlines():
gcode += linenumber() + line + "\n"
gcode += linenumber() + UNITS + "\n"
@@ -252,8 +252,8 @@ def export(objectslist, filename, argstring):
# do the post_amble
if OUTPUT_COMMENTS:
gcode += "(begin postamble)\n"
for line in POSTAMBLE.splitlines(True):
gcode += linenumber() + line
for line in POSTAMBLE.splitlines():
gcode += linenumber() + line + "\n"
if FreeCAD.GuiUp and SHOW_EDITOR:
final = gcode