diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2014-09-28 18:07:15 -0400 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2014-09-28 18:07:15 -0400 |
commit | 695e3d9220be8773f6630bb5c512d122b8576742 (patch) | |
tree | 4de564bd48789c0414f882b96db8ed82a9eb67b4 /gerber/__main__.py | |
parent | 858fc5f6d82c58f4af966c27299e51dd6ba1c097 (diff) | |
download | gerbonara-695e3d9220be8773f6630bb5c512d122b8576742.tar.gz gerbonara-695e3d9220be8773f6630bb5c512d122b8576742.tar.bz2 gerbonara-695e3d9220be8773f6630bb5c512d122b8576742.zip |
Added excellon support and refactored project
Diffstat (limited to 'gerber/__main__.py')
-rw-r--r-- | gerber/__main__.py | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/gerber/__main__.py b/gerber/__main__.py index 6f861cf..d32fa01 100644 --- a/gerber/__main__.py +++ b/gerber/__main__.py @@ -16,16 +16,23 @@ # limitations under the License. if __name__ == '__main__': - from .parser import GerberParser - from .render import GerberContext - - 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 - g = GerberParser(GerberContext()) - g.parse(filename) + from .gerber import GerberFile + from .excellon import ExcellonParser + from .render import GerberSvgContext + + #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 = GerberFile.read('SCB.GTL') + g.render('test.svg', ctx) + p = ExcellonParser(ctx) + p.parse('ncdrill.txt') + p.dump('testwithdrill.svg') + + |