summaryrefslogtreecommitdiff
path: root/gerbonara/aperture_macros/primitive.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-04-29 17:25:32 +0200
committerjaseg <git@jaseg.de>2023-04-30 11:07:29 +0200
commit26c2460490b6e64790c94e00be848465a6a5fa96 (patch)
treec23288bc30772615a758a856a456cc1d74affb31 /gerbonara/aperture_macros/primitive.py
parentaf3458b1e22f92f51606cff8f771d03551af4cc0 (diff)
downloadgerbonara-26c2460490b6e64790c94e00be848465a6a5fa96.tar.gz
gerbonara-26c2460490b6e64790c94e00be848465a6a5fa96.tar.bz2
gerbonara-26c2460490b6e64790c94e00be848465a6a5fa96.zip
Fix remaining unit tests
Diffstat (limited to 'gerbonara/aperture_macros/primitive.py')
-rw-r--r--gerbonara/aperture_macros/primitive.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/gerbonara/aperture_macros/primitive.py b/gerbonara/aperture_macros/primitive.py
index a12a33c..f575b0c 100644
--- a/gerbonara/aperture_macros/primitive.py
+++ b/gerbonara/aperture_macros/primitive.py
@@ -58,8 +58,8 @@ class Primitive:
return str(self)
@classmethod
- def from_arglist(kls, arglist):
- return kls(*arglist)
+ def from_arglist(kls, unit, arglist):
+ return kls(unit, *arglist)
class Calculator:
def __init__(self, instance, variable_binding={}, unit=None):
@@ -267,11 +267,11 @@ class Outline(Primitive):
yield x, y
@classmethod
- def from_arglist(kls, arglist):
- if len(arglist[3:]) % 2 == 0:
- return kls(unit=arglist[0], exposure=arglist[1], length=arglist[2], coords=arglist[3:], rotation=0)
+ def from_arglist(kls, unit, arglist):
+ if len(arglist[2:]) % 2 == 0:
+ return kls(unit=unit, exposure=arglist[0], length=arglist[1], coords=arglist[2:], rotation=0)
else:
- return kls(unit=arglist[0], exposure=arglist[1], length=arglist[2], coords=arglist[3:-1], rotation=arglist[-1])
+ return kls(unit=unit, exposure=arglist[0], length=arglist[1], coords=arglist[2:-1], rotation=arglist[-1])
def __str__(self):
return f'<Outline {len(self.coords)} points>'