addStudy(ior)
GraphName = myGraph.Name()
- print("Befor save ",)
-print "Before save ",
++print("Before save ",)
nodes = myGraph.Nodes()
length_bs = len(nodes)
-print "ListOfNodes length = ", length_bs
+print("ListOfNodes length = ", length_bs)
names=[]
for node in nodes:
names.append(node.Name())
Graph=SuperV.getGraph(ior)
ListOfNodes=Graph.Nodes()
length_as= len(ListOfNodes)
- print "ListOfNodes length = ", length_as
+ print("ListOfNodes length = ", length_as)
if length_as != length_bs:
- raise RuntimeErrror, "defferent length of nodes after study open"
+ raise RuntimeErrror, "different length of nodes after study open"
#aChildIterator.Next()
Names = []
Graph=SuperV.getGraph(ior)
ListOfNodes=Graph.Nodes()
length_as= len(ListOfNodes)
- print "ListOfNodes length = ", length_as
+ print("ListOfNodes length = ", length_as)
if length_as != length_bs:
- raise RuntimeErrror, "defferent length of nodes after study open"
+ raise RuntimeErrror, "different length of nodes after study open"
#aChildIterator.Next()
Names = []
# pass
orb, lcc, naming_service, cm,sg=None,None,None,None,None
-myStudyManager, myStudyId, myStudy, myStudyName=None,None,None,None
-
-def setCurrentStudy(theStudy):
- """
- Change current study : an existing one given by a study object.
-
- :param theStudy: the study CORBA object to set as current study
- """
- global myStudyId, myStudy, myStudyName
- myStudyId, myStudy, myStudyName =salome_study.setCurrentStudy(theStudy)
-
-def setCurrentStudyId(theStudyId=0):
- """
- Change current study : an existing or new one given by Id.
-
- :param theStudyId: the study Id (optional argument)
- 0 : create a new study (default).
- n (>0) : try connection to study with Id = n, or create a new one
- if study not found.
- """
- global myStudyId, myStudy, myStudyName
- myStudyId, myStudy, myStudyName =salome_study.setCurrentStudyId(theStudyId)
+myStudy, myStudyName=None,None
salome_initial=1
-def salome_init(theStudyId=0,embedded=0):
+def salome_init(embedded=0):
"""
- Performs only once SALOME general purpose initialization for scripts.
+ Performs only once SALOME general purpose initialisation for scripts.
- optional argument : theStudyId
- When in embedded interpreter inside IAPP, theStudyId is not used
- When used without GUI (external interpreter)
- 0 : create a new study (default).
- n (>0) : try connection to study with Id = n, or create a new one
- if study not found.
- If study creation, its Id may be different from theStudyId !
Provides:
orb reference to CORBA
lcc a LifeCycleCorba instance
Return true if this enumerate contains the specified key string
@key a key string to test
"""
- return (key in self._dict_keynumbers.keys())
+ return key in self._dict_keynumbers
## Returns true if the specified integer value is defined as an identifier
- # in this enumarate.
+ # in this enumerate.
# \param value a value to test
def isValid(self, value):
"""
Returns true if the specified integer value is defined as an identifier
- in this enumarate.
+ in this enumerate.
@value a value to test
"""
- return (value in self._dict_keynumbers.values())
+ return value in self._dict_numberkeys
## Returns the list of keys in this enumerate.
def listkeys(self):
obj = salome.naming_service.Resolve('Kernel/ModulCatalog')
catalog = obj._narrow(SALOME_ModuleCatalog.ModuleCatalog)
if not catalog:
- raise RuntimeError("Can't accesss module catalog")
- raise RuntimeError, "Can't access module catalog"
++ raise RuntimeError("Can't access module catalog")
return catalog.GetComponentList()
-## Get a study manager to create and manage %SALOME studies
-# \ingroup service
-def getStudyManager():
- """Get a study manager to create and manage SALOME studies"""
- return salome.myStudyManager
-
import SALOMEDS
-## Get a study manager to create and manage SALOME studies.
-# \warning you should use instead the variable salome.myStudyManager.
+## Get a study to create SALOME study.
+# \warning you should use instead the variable salome.myStudy.
# This function is given for illustration of usage of the naming service
# \ingroup service
-def __getStudyManager_demo():
+def __getStudy_demo():
"""
- Get a study manager to create and manage SALOME studies. WARN: you
- should use instead the variable salome.myStudyManager. This
+ Get a study to create SALOME study. WARN: you
+ should use instead the variable salome.myStudy. This
function is given for illustration of usage of the naming service
"""
naming_service = SALOME_NamingServicePy_i( orb )
def SelectedCount(self):
"""Get the number of active selections"""
- print("SalomeOutsideGUI: no selection mecanism available outside GUI")
- print "SalomeOutsideGUI: no selection mechanism available outside GUI"
++ print("SalomeOutsideGUI: no selection mechanism available outside GUI")
return 0
def getSelected(self, i):
"""Get the selection number i """
- print("SalomeOutsideGUI: no selection mecanism available outside GUI")
- return None
- print "SalomeOutsideGUI: no selection mechanism available outside GUI"
++ print("SalomeOutsideGUI: no selection mechanism available outside GUI")
+ return none
def AddIObject(self, Entry):
"""Add an entry"""
obj = salome.naming_service.Resolve('Kernel/ModulCatalog')
catalog = obj._narrow(SALOME_ModuleCatalog.ModuleCatalog)
if not catalog:
- raise RuntimeError("Can't accesss module catalog")
- raise RuntimeError, "Can't access module catalog"
-print "OK"
+
-print
++ raise RuntimeError("Can't access module catalog")
+print("OK")
-print "======================================================================"
-print " %d. Check modules availability in the module catalog " % step; step+=1
-print "======================================================================"
+print()
+
+print("======================================================================")
+print(" %d. Check modules availability in the module catalog " % step); step+=1
+print("======================================================================")
for module in [ "GEOM", "SMESH", "MEDFactory", "PVSERVER"]:
- print
- print "--- Check %s ..." % module
+ print()
+ print("--- Check %s ..." % module)
comp = catalog.GetComponent(module)
if not comp:
- raise RuntimeError, "Component %s is not found in Module Catalog." % module
- print "OK"
+ raise RuntimeError("Component %s is not found in Module Catalog." % module)
+ print("OK")
pass
-print
+print()
-print "======================================================================"
-print " %d. Test Data Server " % step; step+=1
-print "======================================================================"
+print("======================================================================")
+print(" %d. Test Data Server " % step); step+=1
+print("======================================================================")
-print
-print "--- Create new component ..."
+print()
+print("--- Create new component ...")
comp = builder.NewComponent("TEST")
if not comp:
- raise RuntimeError, "Can't create new component"
-print "OK"
+ raise RuntimeError("Can't create new component")
+print("OK")
-print
-print "--- Create AttributeName ..."
+print()
+print("--- Create AttributeName ...")
A = builder.FindOrCreateAttribute(comp, "AttributeName")
if not A:
- raise RuntimeError, "Can't create AttributeName attribute"
+ raise RuntimeError("Can't create AttributeName attribute")
A.SetValue("TEST")
if A.Value() != "TEST":
- raise RuntimeError, "Error : wrong value of AttributeName"
-print "OK"
+ raise RuntimeError("Error : wrong value of AttributeName")
+print("OK")
-print
-print "--- Create AttributeReal ..."
+print()
+print("--- Create AttributeReal ...")
A = builder.FindOrCreateAttribute(comp, "AttributeReal")
if not A:
- raise RuntimeError, "Can't create AttributeReal attribute"
+ raise RuntimeError("Can't create AttributeReal attribute")
A.SetValue(0.0001)
if A.Value() != 0.0001:
- raise RuntimeError, "Error : wrong value of AttributeReal"
-print "OK"
+ raise RuntimeError("Error : wrong value of AttributeReal")
+print("OK")
-print
+print()
-print "======================================================================"
-print " %d. Test Geometry " % step; step+=1
-print "======================================================================"
+print("======================================================================")
+print(" %d. Test Geometry " % step); step+=1
+print("======================================================================")
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
ShapeTypeCompSolid = 1
ShapeTypeSolid = 2
//----------------------------------------------------------------------
// Function : SALOME_ModuleCatalog_AcomponentImpl
// Purpose : Constructor
- // Affect the component name, type,icone
-// Affect the component name, type, icon, and bool to define
-// if it's multi-study or not.
++// Affect the component name, type,icon
// Affect too the constraint and the interfaces of the component
- // and the pathes prefixes for all computers
+ // and the path prefixes for all computers
//----------------------------------------------------------------------
SALOME_ModuleCatalog_AcomponentImpl::SALOME_ModuleCatalog_AcomponentImpl
(SALOME_ModuleCatalog::ComponentDef &C) : _Component(C)
SALOME::KeyWaiter_ptr waitForKeyInVar(const char *varName, const SALOME::ByteVec& keyVal);
SALOME::KeyWaiter_ptr waitForKeyInVarAndKillIt(const char *varName, const SALOME::ByteVec& keyVal, SALOME::Transaction_out transac);
void atomicApply(const SALOME::ListOfTransaction& transactions);
- private:
- PyObject *getPyCmpFunc();
+ SALOME::RequestSwitcher_ptr getRequestSwitcher();
private:
PortableServer::POA_var _poa_for_key_waiter;
std::list< KeyWaiter * > _waiting_keys;
import TestSalomeSDSHelper0
import os,subprocess
fname=os.path.splitext(TestSalomeSDSHelper0.__file__)[0]+".py"
- proc=subprocess.Popen(["python",fname],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+ proc = subprocess.Popen(["python3", fname], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out,err=proc.communicate()
if proc.returncode!=0:
- print out
- print err
+ print("-------------- work -----------")
+ print(out)
+ print(err)
+ print("~~~~~~~~~~~~~~ work ~~~~~~~~~~~")
return proc.returncode
- def func_test7(scopeName,l,l2,cv):
+ def func_test7(scopeName,cv,cv2,cv3,sharedNum):
salome.salome_init()
varName="a"
zeValue={"ab":[4,5,6]}