From: Gilles DAVID Date: Thu, 30 Mar 2017 12:43:29 +0000 (+0200) Subject: Porting to Python 3 (1st draft) X-Git-Tag: V9_0_0~2^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=19c81ea5b50caaf7ac47cdee74d8d12e4eda8733;p=plugins%2Fhybridplugin.git Porting to Python 3 (1st draft) --- diff --git a/bin/createGroupsOnEntitiesFromGMFFile.py b/bin/createGroupsOnEntitiesFromGMFFile.py index c63f863..bbd0a9d 100644 --- a/bin/createGroupsOnEntitiesFromGMFFile.py +++ b/bin/createGroupsOnEntitiesFromGMFFile.py @@ -48,7 +48,7 @@ if the_mesh != None: yellow = SALOMEDS.Color(1,1,0) for i in dir(SMESH): - if "Entity_" in i: print i + if "Entity_" in i: print(i) entities = [("Tetra", SMESH.Entity_Tetra, blue), ("Pyramid", SMESH.Entity_Pyramid, red), diff --git a/src/HYBRIDPlugin/HYBRIDPluginBuilder.py b/src/HYBRIDPlugin/HYBRIDPluginBuilder.py index c2ea69c..682a48f 100644 --- a/src/HYBRIDPlugin/HYBRIDPluginBuilder.py +++ b/src/HYBRIDPlugin/HYBRIDPluginBuilder.py @@ -77,7 +77,7 @@ class HYBRID_Algorithm(Mesh_Algorithm): # if it is @c 0 (default), the algorithm is assigned to the main shape def __init__(self, mesh, geom=0): Mesh_Algorithm.__init__(self) - if noHYBRIDPlugin: print "Warning: HYBRIDPlugin module unavailable" + if noHYBRIDPlugin: print("Warning: HYBRIDPlugin module unavailable") self.Create(mesh, geom, self.algoType, "libHYBRIDEngine.so") self.params = None pass @@ -112,8 +112,7 @@ class HYBRID_Algorithm(Mesh_Algorithm): for f in faces: ids.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, f )) else: - raise TypeError, \ - "Face should be either ID or GEOM_Object, not %s" % type(fid) + raise TypeError("Face should be either ID or GEOM_Object, not %s" % type(fid)) pass self.Parameters().SetFacesWithLayers(ids) if ids: @@ -135,8 +134,7 @@ class HYBRID_Algorithm(Mesh_Algorithm): for f in faces: ids.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, f )) else: - raise TypeError, \ - "Face should be either ID or GEOM_Object, not %s" % type(fid) + raise TypeError("Face should be either ID or GEOM_Object, not %s" % type(fid)) pass self.Parameters().SetFacesWithImprinting(ids) if ids: