]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOM_PY/structelem/__init__.py
Salome HOME
[PYTHON 3] 1st draft
[modules/geom.git] / src / GEOM_PY / structelem / __init__.py
index 80fa0612e1bcbc6e92c6331d9fac11ffcfe1ce6b..648e6d9b49813e9c5ab2ebd45765f2a91097ab8d 100644 (file)
@@ -256,7 +256,7 @@ class StructuralElementManager:
                                         self._studyEditor.studyId, meshGroup,
                                         groupGeomObj, newparams)
                         element.addPart(part)
-                    except InvalidParameterError, e:
+                    except InvalidParameterError as e:
                         logger.error("Invalid parameter error: %s" % e)
                         raise
                     except:
@@ -304,7 +304,7 @@ class StructuralElementManager:
         elif groupMailleParam is not None and meshGroupParam is None:
             meshGroupParam = groupMailleParam
         
-        if isinstance(meshGroupParam, types.StringTypes):
+        if isinstance(meshGroupParam, str):
             meshGroupList = [meshGroupParam]
         else:
             meshGroupList = meshGroupParam
@@ -388,13 +388,13 @@ class StructuralElement:
         newshapes = newpart.baseShapesSet
 
         # Check duplicate groups
-        if self._parts.has_key(newpart.groupName):
+        if newpart.groupName in self._parts:
             logger.warning('Mesh group "%s" is used several times in the '
                            'structural element. Only the last definition '
                            'will be used.' % newpart.groupName)
         else:
             # Check duplicate shapes
-            intersect = newshapes.intersection(self._shapeDict.keys())
+            intersect = newshapes.intersection(list(self._shapeDict.keys()))
             while len(intersect) > 0:
                 shape, = intersect
                 oldpartwithshape = self._shapeDict[shape]
@@ -438,7 +438,7 @@ class StructuralElement:
                              :class:`~orientation.Orientation1D`.
 
         """
-        if self._parts.has_key(meshGroup):
+        if meshGroup in self._parts:
             self._parts[meshGroup].addOrientation(orientParams)
         else:
             logger.warning('Mesh group "%s" not found in structural element, '
@@ -453,7 +453,7 @@ class StructuralElement:
         """
         gg = salome.ImportComponentGUI("GEOM")
         geompy = getGeompy(self._studyEditor.studyId)
-        for part in self._parts.itervalues():
+        for part in self._parts.values():
             # Build the structural element part
             logger.debug("Building %s" % part)
             try: