summaryrefslogtreecommitdiff
path: root/gerber/gerber_statements.py
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2015-04-07 18:24:47 -0300
committerPaulo Henrique Silva <ph.silva@gmail.com>2015-04-07 18:24:47 -0300
commit9ab4ec360c9028122648a881516ce5ed8ae63f77 (patch)
tree791732eba64c66239aabfd4190b9a35fbcf332b9 /gerber/gerber_statements.py
parentb93804ed9a3400099afceacfe5a809ae8bded2a4 (diff)
downloadgerbonara-9ab4ec360c9028122648a881516ce5ed8ae63f77.tar.gz
gerbonara-9ab4ec360c9028122648a881516ce5ed8ae63f77.tar.bz2
gerbonara-9ab4ec360c9028122648a881516ce5ed8ae63f77.zip
Fix parsing for AM macros with zero modifiers
Diffstat (limited to 'gerber/gerber_statements.py')
-rw-r--r--gerber/gerber_statements.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gerber/gerber_statements.py b/gerber/gerber_statements.py
index 39cecf2..4e5ed77 100644
--- a/gerber/gerber_statements.py
+++ b/gerber/gerber_statements.py
@@ -289,7 +289,7 @@ class ADParamStmt(ParamStmt):
ParamStmt.__init__(self, param)
self.d = d
self.shape = shape
- if modifiers is not None:
+ if modifiers:
self.modifiers = [tuple([float(x) for x in m.split("X")]) for m in modifiers.split(",") if len(m)]
else:
self.modifiers = []
@@ -301,7 +301,7 @@ class ADParamStmt(ParamStmt):
self.modifiers = [tuple([metric(x) for x in modifier]) for modifier in self.modifiers]
def to_gerber(self, settings=None):
- if len(self.modifiers):
+ if any(self.modifiers):
return '%ADD{0}{1},{2}*%'.format(self.d, self.shape, ','.join(['X'.join(["%.4g" % x for x in modifier]) for modifier in self.modifiers]))
else:
return '%ADD{0}{1}*%'.format(self.d, self.shape)