Fix test failures

This commit is contained in:
jaseg 2022-01-21 22:05:23 +01:00
parent fd8a259fb0
commit b8142cc08e
4 changed files with 8 additions and 6 deletions

View file

@ -22,4 +22,6 @@ gerbonara provides utilities for working with Gerber (RS-274X) and Excellon
files in python.
"""
from .layers import load_layer, load_layer_data
from .rs274x import GerberFile
from .excellon import ExcellonFile
from .layers import LayerStack

View file

@ -65,7 +65,7 @@ def parse_allegro_ncparam(data, settings=None):
# want to parse, but sometimes due to user error it doesn't end up in the gerber package. In this case, we want to
# still be able to extract the same information from the human-readable ncdrill.log.
if settings is None
if settings is None:
self.settings = FileSettings(number_format=(None, None))
lz_supp, tz_supp = False, False
@ -172,7 +172,7 @@ class ExcellonFile(CamFile):
return kls.from_string(filename.read_text(), settings=settings, filename=filename, plated=plated)
@classmethod
def from_string(kls, data, settings=None, filename=filename, plated=None):
def from_string(kls, data, settings=None, filename=None, plated=None):
parser = ExcellonParser(settings)
parser._do_parse(data)
return kls(objects=parser.objects, comments=parser.comments, import_settings=settings,

View file

@ -222,7 +222,7 @@ class LayerStack:
def __init__(self, graphic_layers, drill_layers, board_name=None):
self.graphic_layers = graphic_layers
self.-drill_layers = drill_layers
self.drill_layers = drill_layers
self.board_name = board_name
def merge_drill_layers(self):

View file

@ -141,7 +141,7 @@ class GerberFile(CamFile):
# dedup apertures
new_apertures = {}
replace_apertures = {}
mock_settings = self.import_settings
mock_settings = FileSettings()
for ap in self.apertures + other.apertures:
gbr = ap.to_gerber(mock_settings)
if gbr not in new_apertures:
@ -825,7 +825,7 @@ class GerberParser:
self.layer_hints.append('bottom silk')
elif 'ETCH' in cmt:
_1, _2, name = cmt.partition('/')
name = re.sub('\W+', '_', name)
name = re.sub(r'\W+', '_', name)
self.layer_hints.append(f'{name} copper')
else: