diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2014-10-19 22:23:00 -0400 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2014-10-19 22:23:00 -0400 |
commit | 18e3b87625ddb739faeddffcaed48e12db6c7e8b (patch) | |
tree | 8b27aa49e431d67e4940d053c2fd640854bd945a /gerber/excellon.py | |
parent | 6d2db67e6d0973ce26ce3a6700ca44295f73fea7 (diff) | |
download | gerbonara-18e3b87625ddb739faeddffcaed48e12db6c7e8b.tar.gz gerbonara-18e3b87625ddb739faeddffcaed48e12db6c7e8b.tar.bz2 gerbonara-18e3b87625ddb739faeddffcaed48e12db6c7e8b.zip |
Test update
Diffstat (limited to 'gerber/excellon.py')
-rwxr-xr-x | gerber/excellon.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/gerber/excellon.py b/gerber/excellon.py index ca2f7c8..780d08f 100755 --- a/gerber/excellon.py +++ b/gerber/excellon.py @@ -44,8 +44,6 @@ def read(filename): detected_settings = detect_excellon_format(filename)
settings = FileSettings(**detected_settings)
zeros = ''
- print('Detected %d:%d format with %s zero suppression' %
- (settings.format[0], settings.format[1], settings.zero_suppression))
return ExcellonParser(settings).parse(filename)
@@ -108,7 +106,6 @@ class ExcellonFile(CamFile): f.write(statement.to_excellon() + '\n')
-
class ExcellonParser(object):
""" Excellon File Parser
@@ -129,10 +126,10 @@ class ExcellonParser(object): self.active_tool = None
self.pos = [0., 0.]
if settings is not None:
- self.units = settings['units']
- self.zero_suppression = settings['zero_suppression']
- self.notation = settings['notation']
- self.format = settings['format']
+ self.units = settings.units
+ self.zero_suppression = settings.zero_suppression
+ self.notation = settings.notation
+ self.format = settings.format
@property
@@ -163,14 +160,14 @@ class ExcellonParser(object): def parse(self, filename):
with open(filename, 'r') as f:
for line in f:
- self._parse(line)
+ self._parse(line.strip())
return ExcellonFile(self.statements, self.tools, self.hits,
self._settings(), filename)
def _parse(self, line):
- line = line.strip()
- zs = self._settings()['zero_suppression']
- fmt = self._settings()['format']
+ #line = line.strip()
+ zs = self._settings().zero_suppression
+ fmt = self._settings().format
if line[0] == ';':
self.statements.append(CommentStmt.from_excellon(line))
|