summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarret Fick <garret@ficksworkshop.com>2016-01-16 18:33:40 +0800
committerGarret Fick <garret@ficksworkshop.com>2016-01-16 18:33:40 +0800
commit60784dfa2107f72fcaeed739b835d647e4c3a7a9 (patch)
treee131ed2a0440f98d197e65977acf8bb82031a04e
parent6a993594130c42adffa9e2d58757b66b48755aad (diff)
downloadgerbonara-60784dfa2107f72fcaeed739b835d647e4c3a7a9.tar.gz
gerbonara-60784dfa2107f72fcaeed739b835d647e4c3a7a9.tar.bz2
gerbonara-60784dfa2107f72fcaeed739b835d647e4c3a7a9.zip
Skip over a strange excellon statement
-rwxr-xr-xgerber/excellon.py9
-rw-r--r--gerber/ncparam/allegro.py25
2 files changed, 31 insertions, 3 deletions
diff --git a/gerber/excellon.py b/gerber/excellon.py
index cdd6d8d..4317e41 100755
--- a/gerber/excellon.py
+++ b/gerber/excellon.py
@@ -500,9 +500,12 @@ class ExcellonParser(object):
self.statements.append(infeed_rate_stmt)
elif line[0] == 'T' and self.state == 'HEADER':
- tool = ExcellonTool.from_excellon(line, self._settings())
- self.tools[tool.number] = tool
- self.statements.append(tool)
+ if not ',OFF' in line and not ',ON' in line:
+ tool = ExcellonTool.from_excellon(line, self._settings())
+ self.tools[tool.number] = tool
+ self.statements.append(tool)
+ else:
+ self.statements.append(UnknownStmt.from_excellon(line))
elif line[0] == 'T' and self.state != 'HEADER':
stmt = ToolSelectionStmt.from_excellon(line)
diff --git a/gerber/ncparam/allegro.py b/gerber/ncparam/allegro.py
new file mode 100644
index 0000000..a67bcf1
--- /dev/null
+++ b/gerber/ncparam/allegro.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# Copyright 2015 Garret Fick <garret@ficksworkshop.com>
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+# http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Allegro File module
+====================
+**Excellon file classes**
+
+Extra parsers for allegro misc files that can be useful when the Excellon file doesn't contain parameter information
+"""
+