Skip to content

Commit

Permalink
FEM: Replace deprecated has_key with in
Browse files Browse the repository at this point in the history
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed Apr 9, 2015
1 parent 135cfbd commit 8de8b99
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Mod/Fem/MechanicalMaterial.py
Expand Up @@ -145,21 +145,21 @@ def transferTo(self):

self.obj.Material = matmap
print 'material data:'
if matmap.has_key('General_name'):
if 'General_name' in matmap:
print ' Name = ', matmap['General_name']
if matmap.has_key('Mechanical_youngsmodulus'):
if 'Mechanical_youngsmodulus' in matmap:
print ' YM = ', matmap['Mechanical_youngsmodulus']
if matmap.has_key('FEM_poissonratio'):
if 'FEM_poissonratio' in matmap:
print ' PR = ', matmap['FEM_poissonratio']

def transferFrom(self):
"Transfer from the object to the dialog"
matmap = self.obj.Material

if matmap.has_key('Mechanical_youngsmodulus'):
if 'Mechanical_youngsmodulus' in matmap:
#print matmap['Mechanical_youngsmodulus']
self.form.spinBox_young_modulus.setText(matmap['Mechanical_youngsmodulus'])
if matmap.has_key('FEM_poissonratio'):
if 'FEM_poissonratio' in matmap:
#print float(matmap['FEM_poissonratio'])
self.form.spinBox_poisson_ratio.setValue(float(matmap['FEM_poissonratio']))

Expand Down Expand Up @@ -190,11 +190,11 @@ def reject(self):
#print 'reject(self)'
matmap = self.obj.Material
print 'material data:'
if matmap.has_key('General_name'):
if 'General_name' in matmap:
print ' Name = ', matmap['General_name']
if matmap.has_key('Mechanical_youngsmodulus'):
if 'Mechanical_youngsmodulus' in matmap:
print ' YM = ', matmap['Mechanical_youngsmodulus']
if matmap.has_key('FEM_poissonratio'):
if 'FEM_poissonratio' in matmap:
print ' PR = ', matmap['FEM_poissonratio']
FreeCADGui.ActiveDocument.resetEdit()

Expand Down

0 comments on commit 8de8b99

Please sign in to comment.