summaryrefslogtreecommitdiff
path: root/gerber/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerber/__main__.py')
-rw-r--r--gerber/__main__.py33
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')
+
+