summaryrefslogtreecommitdiff
path: root/gerbonara
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-04-30 11:27:21 +0200
committerjaseg <git@jaseg.de>2023-04-30 11:27:21 +0200
commitb50587d6ad8d345a561ac724f39e0fcea547cb5c (patch)
tree434b162af2a5d73106ad46cd277aade259e4f039 /gerbonara
parent26c2460490b6e64790c94e00be848465a6a5fa96 (diff)
downloadgerbonara-b50587d6ad8d345a561ac724f39e0fcea547cb5c.tar.gz
gerbonara-b50587d6ad8d345a561ac724f39e0fcea547cb5c.tar.bz2
gerbonara-b50587d6ad8d345a561ac724f39e0fcea547cb5c.zip
Fix dropped aperture macro names
Diffstat (limited to 'gerbonara')
-rw-r--r--gerbonara/aperture_macros/parse.py4
-rw-r--r--gerbonara/rs274x.py1
2 files changed, 2 insertions, 3 deletions
diff --git a/gerbonara/aperture_macros/parse.py b/gerbonara/aperture_macros/parse.py
index d38a83d..d3658a5 100644
--- a/gerbonara/aperture_macros/parse.py
+++ b/gerbonara/aperture_macros/parse.py
@@ -63,7 +63,7 @@ class ApertureMacro:
object.__setattr__(self, 'name', f'GNX{hash(self)&0xffffffffffffffff:016X}')
@classmethod
- def parse_macro(kls, name, body, unit):
+ def parse_macro(kls, macro_name, body, unit):
comments = []
variables = {}
primitives = []
@@ -92,7 +92,7 @@ class ApertureMacro:
primitives.append(ap.PRIMITIVE_CLASSES[int(primitive)].from_arglist(unit, args))
variables = [variables.get(i+1) for i in range(max(variables.keys(), default=0))]
- return kls(name, tuple(primitives), tuple(variables), tuple(comments))
+ return kls(macro_name, tuple(primitives), tuple(variables), tuple(comments))
def __str__(self):
return f'<Aperture macro {self.name}, variables {str(self.variables)}, primitives {self.primitives}>'
diff --git a/gerbonara/rs274x.py b/gerbonara/rs274x.py
index 90c1783..5e05ac7 100644
--- a/gerbonara/rs274x.py
+++ b/gerbonara/rs274x.py
@@ -126,7 +126,6 @@ class GerberFile(CamFile):
settings = FileSettings.defaults()
cache = {}
- macro_cache = {}
macro_names = set()
def lookup(aperture):
nonlocal cache, settings