summaryrefslogtreecommitdiff
path: root/gerber/__main__.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-08 09:27:52 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-08 09:27:52 -0400
commit1653ae5cbe88757e453bccf499dc1b8ccb278e58 (patch)
treeb80b610fb0c5c52c91edbe753947daeb0e39db20 /gerber/__main__.py
parent100ab899ed7a1a49c3401b87b7d6b0f53a043dbc (diff)
downloadgerbonara-1653ae5cbe88757e453bccf499dc1b8ccb278e58.tar.gz
gerbonara-1653ae5cbe88757e453bccf499dc1b8ccb278e58.tar.bz2
gerbonara-1653ae5cbe88757e453bccf499dc1b8ccb278e58.zip
Update readme and example
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')
+