summaryrefslogtreecommitdiff
path: root/gerber/excellon.py
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2015-12-20 22:15:44 -0200
committerPaulo Henrique Silva <ph.silva@gmail.com>2015-12-20 22:15:44 -0200
commitd1598b46c91ee36719460d49d7ba2ed5ecd0ef45 (patch)
tree7e107cc196fade05719f0cc6a659f6f17f6a3b3b /gerber/excellon.py
parent2e2b4e49c3182cc7385f12d760222ecb57cc1356 (diff)
parent163a0cd531c667ec666108562eb2dbec28ce6125 (diff)
downloadgerbonara-d1598b46c91ee36719460d49d7ba2ed5ecd0ef45.tar.gz
gerbonara-d1598b46c91ee36719460d49d7ba2ed5ecd0ef45.tar.bz2
gerbonara-d1598b46c91ee36719460d49d7ba2ed5ecd0ef45.zip
Merge pull request #52 from curtacircuitos/negative_soldermask
Allow negative solder mask rendering per #50.
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