X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FZCracksPlug%2Fmain.py;h=9fb40199c69da9a84bb210b96f3f1f7cc45dea58;hb=HEAD;hp=4d3384de0d64aeb04d6eab57462b60ac78048465;hpb=651e7566c8d9c267c71320c63d3742a92426aa3e;p=modules%2Fsmesh.git diff --git a/src/Tools/ZCracksPlug/main.py b/src/Tools/ZCracksPlug/main.py index 4d3384de0..9fb40199c 100644 --- a/src/Tools/ZCracksPlug/main.py +++ b/src/Tools/ZCracksPlug/main.py @@ -1,3 +1,22 @@ +# Copyright (C) 2016-2024 EDF +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + import sys, pickle, tempfile, shutil from os import path, getpid, environ, remove, system @@ -5,11 +24,11 @@ from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * -import utilityFunctions as uF -import genereCrack, Zset, output, zcracks_ui +from . import utilityFunctions as uF +from . import genereCrack, Zset, output, zcracks_ui -from output import message, init -from zcracks_ui import Ui_Zui +from .output import message, init +from .zcracks_ui import Ui_Zui # --------------------- @@ -21,7 +40,7 @@ def stringToFloat(string, typ=float): if str(string).replace(' ','')=='': out=[] else: - out=map(typ, str(string).split()) + out=list(map(typ, str(string).split())) return(out) def addExtension(string, extension): @@ -266,10 +285,10 @@ class ShipHolderApplication(QGroupBox): else: obj.setText(self.data[self.lineEditNames[cont]]) - self.ui.CBQuad.setChecked(True if 'quad' in self.data.keys() and self.data['quad'] else False) - self.ui.CBBarsoum.setChecked(True if 'barsoum' in self.data.keys() and self.data['barsoum'] else False) - self.ui.CBIs2D.setChecked(True if 'is2D' in self.data.keys() and self.data['is2D'] else False) - self.ui.CBRefine.setChecked(True if 'refine' in self.data.keys() and self.data['refine'] else False) + self.ui.CBQuad.setChecked(True if 'quad' in list(self.data.keys()) and self.data['quad'] else False) + self.ui.CBBarsoum.setChecked(True if 'barsoum' in list(self.data.keys()) and self.data['barsoum'] else False) + self.ui.CBIs2D.setChecked(True if 'is2D' in list(self.data.keys()) and self.data['is2D'] else False) + self.ui.CBRefine.setChecked(True if 'refine' in list(self.data.keys()) and self.data['refine'] else False) self.setTableParameters() @@ -337,10 +356,10 @@ class ShipHolderApplication(QGroupBox): if not test2: message('A','No mesh file to visualize') else: - print medit+' %s' %meshFile2 + print(medit+' %s' %meshFile2) system(medit+' %s' %meshFile2) else: - print medit+' %s' %meshFile1 + print(medit+' %s' %meshFile1) system(medit+' %s' %meshFile1) return() @@ -431,9 +450,8 @@ class ShipHolderApplication(QGroupBox): else: import SMESH, salome #salome.salome_init() - theStudy = salome.myStudy from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(theStudy) + smesh = smeshBuilder.New() ([objetSain], status) = smesh.CreateMeshesFromMED(saneFile)