Salome HOME
Update copyrights
[modules/smesh.git] / src / Tools / ZCracksPlug / casTests / launchCas.py
index 4672776ec901f77b553ea1717468fb5be5a746fc..b84cfc28873ce5efde2f4fa2deef36b6b129e5c4 100644 (file)
@@ -1,7 +1,25 @@
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from Zcracks import genereCrack, Zset
 from Zcracks import utilityFunctions as uF
-import genereCube
+from . import genereCube
 
 from math import sqrt
 
@@ -19,7 +37,7 @@ import string
 #tmpdir = "/local00/home/B27118/projets/Zcracks/Zcracks/casTests/tmpdir"
 #if not os.path.isdir(tmpdir): os.mkdir(tmpdir)
 tmpdir=tempfile.mkdtemp(prefix='tmpZcracks')
-print "tmpdir=", tmpdir
+print("tmpdir=", tmpdir)
 
 #meshgemsdir=os.environ('MESHGEMSHOME')
 #if len(meshgemsdir) > 0:
@@ -27,7 +45,7 @@ print "tmpdir=", tmpdir
   #uF.removeFromSessionPath('LD_LIBRARY_PATH', meshgems)
 
 def LAUNCH(listCas=[]):
-  if type(listCas)!=list: listCas=[listCas]
+  if not isinstance(listCas, list): listCas=[listCas]
 
   N=20
   L=1.
@@ -194,18 +212,18 @@ def LAUNCH(listCas=[]):
 
   OK=[]
   NOOK=[]
-  for s in synthese.keys():
+  for s in synthese:
     if synthese[s]:
       OK.append(s)
     else:
       NOOK.append(s)
 
-  print 'OK:'
-  print OK
-  print ' '
-  print 'NOOK:'
-  print NOOK
-  print ' '
+  print('OK:')
+  print(OK)
+  print(' ')
+  print('NOOK:')
+  print(NOOK)
+  print(' ')
 
   return(synthese)