Added argument support for post processors - examples in linuxcnc_post.py.

This commit is contained in:
Markus Lampert
2016-10-20 14:54:34 -07:00
committed by wmayer
parent 0efa65a8b9
commit 70b445a099
10 changed files with 55 additions and 16 deletions

View File

@@ -79,8 +79,26 @@ TOOL_CHANGE = ''''''
if open.__module__ == '__builtin__':
pythonopen = open
def processArguments(argstring):
global OUTPUT_HEADER
global OUTPUT_COMMENTS
global OUTPUT_LINE_NUMBERS
for arg in argstring.split():
if arg == '--header':
OUTPUT_HEADER = True
elif arg == '--no-header':
OUTPUT_HEADER = False
elif arg == '--comments':
OUTPUT_COMMENTS = True
elif arg == '--no-comments':
OUTPUT_COMMENTS = False
elif arg == '--line-numbers':
OUTPUT_LINE_NUMBERS = True
elif arg == '--no-line-numbers':
OUTPUT_LINE_NUMBERS = False
def export(objectslist, filename):
def export(objectslist, filename, argstring):
processArguments(argstring)
global UNITS
for obj in objectslist:
if not hasattr(obj, "Path"):
@@ -168,7 +186,6 @@ def linenumber():
return "N" + str(LINENR) + " "
return ""
def parse(pathobj):
out = ""
lastcommand = None