diff options
Diffstat (limited to 'gerber')
-rw-r--r-- | gerber/ipc356.py | 3 | ||||
-rw-r--r-- | gerber/layers.py | 6 | ||||
-rw-r--r-- | gerber/pcb.py | 3 | ||||
-rw-r--r-- | gerber/render/cairo_backend.py | 2 | ||||
-rw-r--r-- | gerber/tests/test_layers.py | 2 |
5 files changed, 10 insertions, 6 deletions
diff --git a/gerber/ipc356.py b/gerber/ipc356.py index a831c0f..9337a99 100644 --- a/gerber/ipc356.py +++ b/gerber/ipc356.py @@ -281,7 +281,8 @@ class IPC356_TestRecord(object): units = settings.units angle = settings.angle_units feature_types = {'1': 'through-hole', '2': 'smt', - '3': 'tooling-feature', '4': 'tooling-hole'} + '3': 'tooling-feature', '4': 'tooling-hole', + '6': 'non-plated-tooling-hole'} access = ['both', 'top', 'layer2', 'layer3', 'layer4', 'layer5', 'layer6', 'layer7', 'bottom'] record = {} diff --git a/gerber/layers.py b/gerber/layers.py index c80baa4..5c26412 100644 --- a/gerber/layers.py +++ b/gerber/layers.py @@ -122,11 +122,11 @@ def guess_layer_class(filename): pass
try:
- directory, name = os.path.split(filename)
- name, ext = os.path.splitext(name.lower())
+ directory, filename = os.path.split(filename)
+ name, ext = os.path.splitext(filename.lower())
for hint in hints:
if hint.regex:
- if re.findall(hint.regex, name, re.IGNORECASE):
+ if re.findall(hint.regex, filename, re.IGNORECASE):
return hint.layer
patterns = [r'^(\w*[.-])*{}([.-]\w*)?$'.format(x) for x in hint.name]
diff --git a/gerber/pcb.py b/gerber/pcb.py index a213fb3..ba15161 100644 --- a/gerber/pcb.py +++ b/gerber/pcb.py @@ -48,6 +48,9 @@ class PCB(object): except ParseError: if verbose: print('[PCB]: Skipping file {}'.format(filename)) + except IOError: + if verbose: + print('[PCB]: Skipping file {}'.format(filename)) # Try to guess board name if board_name is None: diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py index e1d1408..7c01319 100644 --- a/gerber/render/cairo_backend.py +++ b/gerber/render/cairo_backend.py @@ -532,7 +532,7 @@ class GerberCairoContext(GerberContext): def new_render_layer(self, color=None, mirror=False): size_in_pixels = self.scale_point(self.size_in_inch) - matrix = copy.copy(self._xform_matrix) + matrix = cairo.Matrix() * self._xform_matrix layer = cairo.SVGSurface(None, size_in_pixels[0], size_in_pixels[1]) ctx = cairo.Context(layer) diff --git a/gerber/tests/test_layers.py b/gerber/tests/test_layers.py index 597c0d3..3a21a2c 100644 --- a/gerber/tests/test_layers.py +++ b/gerber/tests/test_layers.py @@ -61,7 +61,7 @@ def test_guess_layer_class_regex(): Hint(layer='top', ext=[], name=[], - regex=r'(.*)(\scopper top|\stop copper)$', + regex=r'(.*)(\scopper top|\stop copper).gbr', content=[] ), ] |