X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2Fsmesh.py;h=99ab3db11d537af2fb76582b1450015b29d5f34b;hp=ab9a6f031c90f85558387f9722ba7447a7c03258;hb=67dba15dfdd0b7f7a2671a70ad831a080a9c0487;hpb=54182913fbb9df65a3f4cc96f55db3618835ecd8 diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index ab9a6f031..99ab3db11 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -33,6 +33,7 @@ import salome from salome import * import geompy + import SMESH, SALOMEDS from salome.smesh import smeshBuilder @@ -43,11 +44,13 @@ try: engineSmesh = salome.lcc.FindOrLoadComponent( "FactoryServer", "SMESH" ) smesh = smeshBuilder.New(salome.myStudy, engineSmesh) except: + print "exception in smesh.py: instance creation failed" smesh = None pass # load plugins and add dynamically generated methods to Mesh class, # the same for for global variables declared by plug-ins +from salome.smesh.smeshBuilder import * from salome.smesh.smeshBuilder import Mesh, algoCreator for pluginName in os.environ[ "SMESH_MeshersList" ].split( ":" ): # @@ -56,7 +59,8 @@ for pluginName in os.environ[ "SMESH_MeshersList" ].split( ":" ): try: exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName)) except Exception, e: - print "Exception while loading %s: %s" % ( pluginBuilderName, e ) + from salome_utils import verbose + if verbose(): print "Exception while loading %s: %s" % ( pluginBuilderName, e ) continue exec( "from salome.%s import %s" % (pluginName, pluginBuilderName)) plugin = eval( pluginBuilderName ) @@ -85,28 +89,30 @@ if smesh: print """ =============================================================================== -WARNING: | -Usage of smesh.py is deprecated in SALOME V7.2! | -smesh.py will be removed in a future version! | -TODO: | -The following changes in your scripts are required to avoid this message: | - | -replace | -------- | - | -import smesh, SMESH, SALOMEDS | -smesh.SetCurrentStudy(theStudy) | - | -with | ----- | - | -import SMESH, SALOMEDS | -from salome.smesh import smeshBuilder | -smesh = smeshBuilder.New(theStudy) | - | -you also need to modify some lines where smeshBuilder is used instead of smesh| - | -algo=smesh.xxxx ==> algo.smeshBuilder.xxxx | - | +WARNING: +Usage of smesh.py is deprecated in SALOME V7.2! +smesh.py will be removed in a future version! +TODO: +The following changes in your scripts are required to avoid this message: + +replace +------- + +import smesh, SMESH +smesh.SetCurrentStudy(theStudy) + +with +---- + +import SMESH +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New(salome.myStudy) + +you also need to modify some lines where smeshBuilder is used instead of smesh + +algo=smesh.xxxx ==> algo=smeshBuilder.xxxx + +See also SMESH User's Guide for more details + =============================================================================== """