- minor changes to increase compatibility with Python 3.8

This commit is contained in:
Marius Stanciu
2020-04-01 18:45:20 +03:00
committed by Marius
parent d326524fe3
commit 3d39916b5f
17 changed files with 72 additions and 67 deletions

View File

@@ -3393,7 +3393,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.app.log.debug("on_tool_select('%s')" % tool)
if self.last_tool_selected is None and current_tool is not 'drill_select':
if self.last_tool_selected is None and current_tool != 'drill_select':
# self.draw_app.select_tool('drill_select')
self.complete = True
current_tool = 'drill_select'

View File

@@ -1327,11 +1327,11 @@ class TransformEditorTool(FlatCAMTool):
# execute mirroring
for sha in shape_list:
if axis is 'X':
if axis == 'X':
sha.mirror('X', (px, py))
self.app.inform.emit('[success] %s...' %
_('Flip on the Y axis done'))
elif axis is 'Y':
elif axis == 'Y':
sha.mirror('Y', (px, py))
self.app.inform.emit('[success] %s' %
_('Flip on the X axis done'))
@@ -1368,9 +1368,9 @@ class TransformEditorTool(FlatCAMTool):
yminimal = min(yminlist)
for sha in shape_list:
if axis is 'X':
if axis == 'X':
sha.skew(num, 0, point=(xminimal, yminimal))
elif axis is 'Y':
elif axis == 'Y':
sha.skew(0, num, point=(xminimal, yminimal))
self.draw_app.replot()
@@ -1449,9 +1449,9 @@ class TransformEditorTool(FlatCAMTool):
with self.app.proc_container.new(_("Applying Offset")):
try:
for sha in shape_list:
if axis is 'X':
if axis == 'X':
sha.offset((num, 0))
elif axis is 'Y':
elif axis == 'Y':
sha.offset((0, num))
self.draw_app.replot()

View File

@@ -4254,7 +4254,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.app.log.debug("on_tool_select('%s')" % tool)
if self.last_aperture_selected is None and current_tool is not 'select':
if self.last_aperture_selected is None and current_tool != 'select':
# self.draw_app.select_tool('select')
self.complete = True
current_tool = 'select'
@@ -5867,7 +5867,7 @@ class TransformEditorTool(FlatCAMTool):
# execute mirroring
for sel_el_shape in elem_list:
sel_el = sel_el_shape.geo
if axis is 'X':
if axis == 'X':
if 'solid' in sel_el:
sel_el['solid'] = affinity.scale(sel_el['solid'], xfact=1, yfact=-1, origin=(px, py))
if 'follow' in sel_el:
@@ -5876,7 +5876,7 @@ class TransformEditorTool(FlatCAMTool):
sel_el['clear'] = affinity.scale(sel_el['clear'], xfact=1, yfact=-1, origin=(px, py))
self.app.inform.emit('[success] %s...' %
_('Flip on the Y axis done'))
elif axis is 'Y':
elif axis == 'Y':
if 'solid' in sel_el:
sel_el['solid'] = affinity.scale(sel_el['solid'], xfact=-1, yfact=1, origin=(px, py))
if 'follow' in sel_el:
@@ -5924,14 +5924,14 @@ class TransformEditorTool(FlatCAMTool):
for sel_el_shape in elem_list:
sel_el = sel_el_shape.geo
if axis is 'X':
if axis == 'X':
if 'solid' in sel_el:
sel_el['solid'] = affinity.skew(sel_el['solid'], num, 0, origin=(xminimal, yminimal))
if 'follow' in sel_el:
sel_el['follow'] = affinity.skew(sel_el['follow'], num, 0, origin=(xminimal, yminimal))
if 'clear' in sel_el:
sel_el['clear'] = affinity.skew(sel_el['clear'], num, 0, origin=(xminimal, yminimal))
elif axis is 'Y':
elif axis == 'Y':
if 'solid' in sel_el:
sel_el['solid'] = affinity.skew(sel_el['solid'], 0, num, origin=(xminimal, yminimal))
if 'follow' in sel_el:
@@ -6031,14 +6031,14 @@ class TransformEditorTool(FlatCAMTool):
try:
for sel_el_shape in elem_list:
sel_el = sel_el_shape.geo
if axis is 'X':
if axis == 'X':
if 'solid' in sel_el:
sel_el['solid'] = affinity.translate(sel_el['solid'], num, 0)
if 'follow' in sel_el:
sel_el['follow'] = affinity.translate(sel_el['follow'], num, 0)
if 'clear' in sel_el:
sel_el['clear'] = affinity.translate(sel_el['clear'], num, 0)
elif axis is 'Y':
elif axis == 'Y':
if 'solid' in sel_el:
sel_el['solid'] = affinity.translate(sel_el['solid'], 0, num)
if 'follow' in sel_el: