- converted from Python2 code to Python3 code

- in camlib.py, CNCJob class -> generate_from_excellon_by_tool() was
failing in the line to sort the tools due of been unable to compare
between dict's. I replaced that section.
This commit is contained in:
Marius Stanciu
2018-05-26 04:43:40 +03:00
parent bb3b07455c
commit a4bbb98bf1
76 changed files with 394 additions and 389 deletions

View File

@@ -75,66 +75,66 @@ class PaintConnectTest(PaintTestCase):
self.boundary = Polygon([[0, 0], [0, 5], [5, 5], [5, 0]])
def test_jump(self):
print "Test: WALK Expected"
print("Test: WALK Expected")
paths = [
LineString([[0.5, 2], [2, 4.5]]),
LineString([[2, 0.5], [4.5, 2]])
]
for p in paths:
print p
print(p)
tooldia = 1.0
print "--"
print("--")
result = Geometry.paint_connect(mkstorage(deepcopy(paths)), self.boundary, tooldia)
result = list(result.get_objects())
for r in result:
print r
print(r)
self.assertEqual(len(result), 1)
# self.plot_summary_A(paths, tooldia, result, "WALK expected.")
def test_no_jump1(self):
print "Test: FLY Expected"
print("Test: FLY Expected")
paths = [
LineString([[0, 2], [2, 5]]),
LineString([[2, 0], [5, 2]])
]
for p in paths:
print p
print(p)
tooldia = 1.0
print "--"
print("--")
result = Geometry.paint_connect(mkstorage(deepcopy(paths)), self.boundary, tooldia)
result = list(result.get_objects())
for r in result:
print r
print(r)
self.assertEqual(len(result), len(paths))
# self.plot_summary_A(paths, tooldia, result, "FLY Expected")
def test_no_jump2(self):
print "Test: FLY Expected"
print("Test: FLY Expected")
paths = [
LineString([[0.5, 2], [2, 4.5]]),
LineString([[2, 0.5], [4.5, 2]])
]
for p in paths:
print p
print(p)
tooldia = 1.1
print "--"
print("--")
result = Geometry.paint_connect(mkstorage(deepcopy(paths)), self.boundary, tooldia)
result = list(result.get_objects())
for r in result:
print r
print(r)
self.assertEqual(len(result), len(paths))
@@ -153,22 +153,22 @@ class PaintConnectTest2(PaintTestCase):
)
def test_no_jump3(self):
print "TEST: No jump expected"
print("TEST: No jump expected")
paths = [
LineString([[0.5, 1], [1.5, 3]]),
LineString([[4, 1], [4, 4]])
]
for p in paths:
print p
print(p)
tooldia = 1.0
print "--"
print("--")
result = Geometry.paint_connect(mkstorage(deepcopy(paths)), self.boundary, tooldia)
result = list(result.get_objects())
for r in result:
print r
print(r)
self.assertEqual(len(result), len(paths))
@@ -182,26 +182,26 @@ class PaintConnectTest3(PaintTestCase):
def setUp(self):
self.boundary = Polygon([[0, 0], [0, 5], [5, 5], [5, 0]])
print "TEST w/ LinearRings"
print("TEST w/ LinearRings")
def test_jump2(self):
print "Test: WALK Expected"
print("Test: WALK Expected")
paths = [
LineString([[0.5, 2], [2, 4.5]]),
LineString([[2, 0.5], [4.5, 2]]),
self.boundary.buffer(-0.5).exterior
]
for p in paths:
print p
print(p)
tooldia = 1.0
print "--"
print("--")
result = Geometry.paint_connect(mkstorage(deepcopy(paths)), self.boundary, tooldia)
result = list(result.get_objects())
for r in result:
print r
print(r)
self.assertEqual(len(result), 1)