summaryrefslogtreecommitdiff
path: root/gerber/pcb.py
diff options
context:
space:
mode:
authorChintalagiri Shashank <shashank.chintalagiri@gmail.com>2019-05-10 23:40:56 +0530
committerChintalagiri Shashank <shashank.chintalagiri@gmail.com>2019-05-10 23:40:56 +0530
commit4aca5b8a02be8d648b7a2d5f462c6b80c6a6edda (patch)
tree1b0f040282933ce2ed253e332311f658901ef0b3 /gerber/pcb.py
parent2601ae8eab8d7be807bdbed264cd943e441a8da0 (diff)
downloadgerbonara-4aca5b8a02be8d648b7a2d5f462c6b80c6a6edda.tar.gz
gerbonara-4aca5b8a02be8d648b7a2d5f462c6b80c6a6edda.tar.bz2
gerbonara-4aca5b8a02be8d648b7a2d5f462c6b80c6a6edda.zip
Correctly recognize gEDA pcb generated gerber filenames
Diffstat (limited to 'gerber/pcb.py')
-rw-r--r--gerber/pcb.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/gerber/pcb.py b/gerber/pcb.py
index ba15161..69f071e 100644
--- a/gerber/pcb.py
+++ b/gerber/pcb.py
@@ -18,7 +18,7 @@
import os
from .exceptions import ParseError
-from .layers import PCBLayer, sort_layers
+from .layers import PCBLayer, sort_layers, layer_signatures
from .common import read as gerber_read
from .utils import listdir
@@ -41,7 +41,14 @@ class PCB(object):
camfile = gerber_read(os.path.join(directory, filename))
layer = PCBLayer.from_cam(camfile)
layers.append(layer)
- names.add(os.path.splitext(filename)[0])
+ name = os.path.splitext(filename)[0]
+ if len(os.path.splitext(filename)) > 1:
+ _name, ext = os.path.splitext(name)
+ if ext[1:] in layer_signatures(layer.layer_class):
+ name = _name
+ if layer.layer_class == 'drill' and 'drill' in ext:
+ name = _name
+ names.add(name)
if verbose:
print('[PCB]: Added {} layer <{}>'.format(layer.layer_class,
filename))