From 5f456cc260c231942196337318cd0bb1ccc49a72 Mon Sep 17 00:00:00 2001 From: Gilles DAVID Date: Wed, 29 Mar 2017 18:20:49 +0200 Subject: [PATCH] Porting to Python 3 (1st draft) --- doc/salome/examples/hexoticsubdom1.py | 2 +- doc/salome/examples/hexoticsubdom2.py | 2 +- doc/salome/examples/hexoticsubdom3.py | 2 +- src/HexoticPlugin/HexoticPLUGINBuilder.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/salome/examples/hexoticsubdom1.py b/doc/salome/examples/hexoticsubdom1.py index 8781911..a29aedb 100644 --- a/doc/salome/examples/hexoticsubdom1.py +++ b/doc/salome/examples/hexoticsubdom1.py @@ -51,7 +51,7 @@ aFilter2 = smesh.GetFilterFromCriteria([smesh.GetCriterion(SMESH.VOLUME,SMESH.FT aFilter3 = smesh.GetFilter(SMESH.VOLUME,SMESH.FT_BelongToGeom,'=',Sphere_1, SMESH.FT_LogicalNOT) # Create mesh of Cut_2 with sd mode 1 -print "Create mesh of Cut_2 with sd mode 1" +print("Create mesh of Cut_2 with sd mode 1") Mesh_mghexa_sd1 = smesh.Mesh(Cut_2, "Mesh_mghexa_sd1") # Create the 2D algo: MG-CADSurf with geometrical mesh diff --git a/doc/salome/examples/hexoticsubdom2.py b/doc/salome/examples/hexoticsubdom2.py index 500270a..0bb36ad 100644 --- a/doc/salome/examples/hexoticsubdom2.py +++ b/doc/salome/examples/hexoticsubdom2.py @@ -50,7 +50,7 @@ aFilter2 = smesh.GetFilterFromCriteria([smesh.GetCriterion(SMESH.VOLUME,SMESH.FT aFilter3 = smesh.GetFilter(SMESH.VOLUME,SMESH.FT_BelongToGeom,'=',Sphere_1, SMESH.FT_LogicalNOT) # Create mesh of Cut_2 with sd mode 2 -print "Create mesh of Cut_2 with sd mode 2" +print("Create mesh of Cut_2 with sd mode 2") Mesh_mghexa_sd2 = smesh.Mesh(Cut_2, "Mesh_mghexa_sd2") # Create the 2D algo: MG-CADSurf with geometrical mesh diff --git a/doc/salome/examples/hexoticsubdom3.py b/doc/salome/examples/hexoticsubdom3.py index ef7cc20..1eb9980 100644 --- a/doc/salome/examples/hexoticsubdom3.py +++ b/doc/salome/examples/hexoticsubdom3.py @@ -50,7 +50,7 @@ aFilter2 = smesh.GetFilterFromCriteria([smesh.GetCriterion(SMESH.VOLUME,SMESH.FT aFilter3 = smesh.GetFilter(SMESH.VOLUME,SMESH.FT_BelongToGeom,'=',Sphere_1, SMESH.FT_LogicalNOT) # Create mesh of Cut_2 with sd mode 3 -print "Create mesh of Cut_2 with sd mode 3" +print("Create mesh of Cut_2 with sd mode 3") Mesh_mghexa_sd3 = smesh.Mesh(Cut_2, "Mesh_mghexa_sd3") # Create the 2D algo: MG-CADSurf with geometrical mesh diff --git a/src/HexoticPlugin/HexoticPLUGINBuilder.py b/src/HexoticPlugin/HexoticPLUGINBuilder.py index 7fd42ce..684f638 100644 --- a/src/HexoticPlugin/HexoticPLUGINBuilder.py +++ b/src/HexoticPlugin/HexoticPLUGINBuilder.py @@ -70,7 +70,7 @@ class Hexotic_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 noHexoticPlugin: print "Warning: HexoticPlugin module unavailable" + if noHexoticPlugin: print("Warning: HexoticPlugin module unavailable") self.Create(mesh, geom, MG_Hexa, "libHexoticEngine.so") self.params = None pass @@ -100,7 +100,7 @@ class Hexotic_Algorithm(Mesh_Algorithm): def SetSizeMap(self, theObject, theSize): AssureGeomPublished( self.mesh, theObject ) if theSize <= 0: - raise ValueError, "The size must be > 0" + raise ValueError("The size must be > 0") self.Parameters().SetSizeMap(theObject, theSize) return self.Parameters() @@ -125,7 +125,7 @@ class Hexotic_Algorithm(Mesh_Algorithm): # @param quad not documented # @return hypothesis object def MinMaxQuad(self, min=3, max=8, quad=True): - print "WARNING: Function MinMaxQuad is deprecated, use SetMinMaxHexes instead" + print("WARNING: Function MinMaxQuad is deprecated, use SetMinMaxHexes instead") return self.SetMinMaxHexes(min, max) ## Defines "ViscousLayers" hypothesis to give MG-Hexa parameters -- 2.39.2