summaryrefslogtreecommitdiff
path: root/gerber/excellon_statements.py
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2015-01-15 05:01:40 -0200
committerPaulo Henrique Silva <ph.silva@gmail.com>2015-01-15 05:01:40 -0200
commit0f36084aadc85670b96ca63a8258d18db4b18cf8 (patch)
tree118ff300cc6819283759b883126673c32981d7db /gerber/excellon_statements.py
parent137c73f3e42281de67bde8f1c0b16938f5b8aeeb (diff)
downloadgerbonara-0f36084aadc85670b96ca63a8258d18db4b18cf8.tar.gz
gerbonara-0f36084aadc85670b96ca63a8258d18db4b18cf8.tar.bz2
gerbonara-0f36084aadc85670b96ca63a8258d18db4b18cf8.zip
Add Repeat Hole Stmt and fix UnitStmt parsing
* Repeat hole support (with no real parsing, just a copy) * Fix UnitStmt to works even when a ,TZ or ,LZ information is not provided.
Diffstat (limited to 'gerber/excellon_statements.py')
-rw-r--r--gerber/excellon_statements.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/gerber/excellon_statements.py b/gerber/excellon_statements.py
index c4f4015..02bb923 100644
--- a/gerber/excellon_statements.py
+++ b/gerber/excellon_statements.py
@@ -29,7 +29,7 @@ __all__ = ['ExcellonTool', 'ToolSelectionStmt', 'CoordinateStmt',
'RewindStopStmt', 'EndOfProgramStmt', 'UnitStmt',
'IncrementalModeStmt', 'VersionStmt', 'FormatStmt', 'LinkToolStmt',
'MeasuringModeStmt', 'RouteModeStmt', 'DrillModeStmt', 'AbsoluteModeStmt',
- 'UnknownStmt',
+ 'RepeatHoleStmt', 'UnknownStmt',
]
@@ -280,6 +280,22 @@ class CoordinateStmt(ExcellonStatement):
return '<Coordinate Statement: %s>' % coord_str
+class RepeatHoleStmt(ExcellonStatement):
+
+ @classmethod
+ def from_excellon(cls, line, settings):
+ return cls(line)
+
+ def __init__(self, line):
+ self.line = line
+
+ def to_excellon(self, settings):
+ return self.line
+
+ def __str__(self):
+ return '<Repeat Hole: %s>' % self.line
+
+
class CommentStmt(ExcellonStatement):
@classmethod
@@ -478,6 +494,9 @@ class UnknownStmt(ExcellonStatement):
def to_excellon(self, settings=None):
return self.stmt
+ def __str__(self):
+ return "<UnknownStmt: %s >" % self.stmt
+
def pairwise(iterator):
""" Iterate over list taking two elements at a time.