From e640b3b361a401b4670be04badf14f610a8ad62a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 4 Aug 2017 17:22:53 +0200 Subject: o Write the list of files to generate to a file from the python code instead of piping the standard output as it can contain output from KiCAD. --- py/kicad_gerber.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'py') diff --git a/py/kicad_gerber.py b/py/kicad_gerber.py index bc73a44..173aae1 100755 --- a/py/kicad_gerber.py +++ b/py/kicad_gerber.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from __future__ import print_function import sys import os import argparse @@ -27,8 +28,8 @@ parser.add_argument('--output-directory', parser.add_argument('--detect-files-only', dest='detect_files_only', - action='store_true', - help='Don\'t create the GERBER files, just list the files to be created') + action='store', + help='Don\'t create the GERBER files, just write a list of to be created') parser.add_argument('--create-drill-map-file', dest='create_drill_map_file', @@ -161,12 +162,13 @@ for plan in plot_plan: # print "filename: " + plan.filename if args.detect_files_only: - for plan in plot_plan: - print plan.filename + with open(args.detect_files_only, "w") as f: + for plan in plot_plan: + print(plan.filename, file=f) - if args.protel_extensions: - print drlFileOut - print drlNpthFileOut + if args.protel_extensions: + print(drlFileOut, file=f) + print(drlNpthFileOut, file=f) sys.exit(0) # Set some important plot options: -- cgit v1.2.3