summaryrefslogtreecommitdiff
path: root/gerber/excellon.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2015-12-19 21:54:29 -0500
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2015-12-19 21:54:29 -0500
commit1cb269131bc52f0b1a1e69cef0466f2d994d52a8 (patch)
tree25555820946f2d7a7eac9b242bb160a883e8b0ad /gerber/excellon.py
parent2e2b4e49c3182cc7385f12d760222ecb57cc1356 (diff)
downloadgerbonara-1cb269131bc52f0b1a1e69cef0466f2d994d52a8.tar.gz
gerbonara-1cb269131bc52f0b1a1e69cef0466f2d994d52a8.tar.bz2
gerbonara-1cb269131bc52f0b1a1e69cef0466f2d994d52a8.zip
Allow negative render of soldermask per #50
Update example code and rendering to show change
Diffstat (limited to 'gerber/excellon.py')
-rwxr-xr-xgerber/excellon.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/gerber/excellon.py b/gerber/excellon.py
index 708f50b..3bb8611 100755
--- a/gerber/excellon.py
+++ b/gerber/excellon.py
@@ -56,6 +56,7 @@ def read(filename):
settings = FileSettings(**detect_excellon_format(data))
return ExcellonParser(settings).parse(filename)
+
def loads(data):
""" Read data from string and return an ExcellonFile
Parameters
@@ -332,13 +333,13 @@ class ExcellonParser(object):
def parse_raw(self, data, filename=None):
for line in StringIO(data):
- self._parse(line.strip())
+ self._parse_line(line.strip())
for stmt in self.statements:
stmt.units = self.units
return ExcellonFile(self.statements, self.tools, self.hits,
self._settings(), filename)
- def _parse(self, line):
+ def _parse_line(self, line):
# skip empty lines
if not line.strip():
return
@@ -477,7 +478,7 @@ class ExcellonParser(object):
elif line[0] == 'T' and self.state != 'HEADER':
stmt = ToolSelectionStmt.from_excellon(line)
self.statements.append(stmt)
-
+
# T0 is used as END marker, just ignore
if stmt.tool != 0:
# FIXME: for weird files with no tools defined, original calc from gerbv