summaryrefslogtreecommitdiff
path: root/gerber/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerber/__main__.py')
-rw-r--r--gerber/__main__.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/gerber/__main__.py b/gerber/__main__.py
index 26f36e1..ab0f377 100644
--- a/gerber/__main__.py
+++ b/gerber/__main__.py
@@ -16,20 +16,20 @@
# the License.
if __name__ == '__main__':
- import gerber
- import excellon
+ from .common import read
from .render import GerberSvgContext
+ import sys
+
+ if len(sys.argv) < 2:
+ print >> sys.stderr, "Usage: python -m gerber <filename> <filename>..."
+ sys.exit(1)
- #import sys
- #
- #if len(sys.argv) < 2:`
- # print >> sys.stderr, "Usage: python -m gerber <filename> <filename>..."
- # sys.exit(1)
- #
- ##for filename in sys.argv[1]:
- ## print "parsing %s" % filename
ctx = GerberSvgContext()
- g = gerber.read('examples/test.gtl')
- g.render('test.svg', ctx)
- p = excellon.read('ncdrill.txt')
- p.render('testwithdrill.svg', ctx)
+
+ for filename in sys.argv[1:]:
+ print "parsing %s" % filename
+ gerberfile = read(filename)
+ gerberfile.render(ctx)
+ print('Saving image to test.svg')
+ ctx.dump('test.svg')
+