summaryrefslogtreecommitdiff
path: root/gerber/excellon.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2015-02-18 21:14:30 -0500
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2015-02-18 21:14:30 -0500
commite71d7a24b5be3e68d36494869595eec934db4bd2 (patch)
treef48e714895acaecedc4d8bdf323b01a8c2a043c1 /gerber/excellon.py
parent8e4fc555048d411c2d7c894a1e44d4ea73e821a8 (diff)
downloadgerbonara-e71d7a24b5be3e68d36494869595eec934db4bd2.tar.gz
gerbonara-e71d7a24b5be3e68d36494869595eec934db4bd2.tar.bz2
gerbonara-e71d7a24b5be3e68d36494869595eec934db4bd2.zip
Python 3 tests passing
Diffstat (limited to 'gerber/excellon.py')
-rwxr-xr-xgerber/excellon.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/gerber/excellon.py b/gerber/excellon.py
index a339827..ebc307f 100755
--- a/gerber/excellon.py
+++ b/gerber/excellon.py
@@ -142,7 +142,7 @@ class ExcellonFile(CamFile):
self.units = 'metric'
for statement in self.statements:
statement.to_metric()
- for tool in self.tools.itervalues():
+ for tool in iter(self.tools.values()):
tool.to_metric()
for primitive in self.primitives:
primitive.to_metric()
@@ -290,7 +290,7 @@ class ExcellonParser(object):
elif line[0] == 'R' and self.state != 'HEADER':
stmt = RepeatHoleStmt.from_excellon(line, self._settings())
self.statements.append(stmt)
- for i in xrange(stmt.count):
+ for i in range(stmt.count):
self.pos[0] += stmt.xdelta
self.pos[1] += stmt.ydelta
self.hits.append((self.active_tool, tuple(self.pos)))
@@ -390,8 +390,8 @@ def detect_excellon_format(filename):
pass
# See if any of the dimensions are left with only a single option
- formats = set(key[0] for key in results.iterkeys())
- zeros = set(key[1] for key in results.iterkeys())
+ formats = set(key[0] for key in iter(results.keys()))
+ zeros = set(key[1] for key in iter(results.keys()))
if len(formats) == 1:
detected_format = formats.pop()
if len(zeros) == 1:
@@ -408,7 +408,7 @@ def detect_excellon_format(filename):
size, count, diameter = results[key]
scores[key] = _layer_size_score(size, count, diameter)
minscore = min(scores.values())
- for key in scores.iterkeys():
+ for key in iter(scores.keys()):
if scores[key] == minscore:
return {'format': key[0], 'zeros': key[1]}