From b00708915f2ac124543b33eac6f240b65e93f82f Mon Sep 17 00:00:00 2001 From: imn Date: Mon, 14 Nov 2016 14:15:25 +0300 Subject: [PATCH] Additional fix for delete boolean parameter in method: "updateObjBrowser" --- src/KERNEL_PY/Help.py | 2 +- src/KERNEL_PY/__init__.py | 2 +- src/KERNEL_PY/batchmode_salome.py | 10 +++---- src/KERNEL_PY/salome_iapp.py | 2 +- src/KERNEL_PY/salome_study.py | 28 ++++--------------- src/KERNEL_PY/salome_test.py | 6 ++-- .../SALOMEDSClient_ClientFactory.cxx | 1 - src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 2 +- 8 files changed, 17 insertions(+), 36 deletions(-) diff --git a/src/KERNEL_PY/Help.py b/src/KERNEL_PY/Help.py index d349d3f2f..7cebb8f65 100755 --- a/src/KERNEL_PY/Help.py +++ b/src/KERNEL_PY/Help.py @@ -52,7 +52,7 @@ variables: with a Server name and an Engine name salome.sg methods: - updateObjBrowser(bool): + updateObjBrowser(): getStudyName(): SelectedCount(): returns number of selected objects diff --git a/src/KERNEL_PY/__init__.py b/src/KERNEL_PY/__init__.py index 5d0cb75e7..31adec9dd 100755 --- a/src/KERNEL_PY/__init__.py +++ b/src/KERNEL_PY/__init__.py @@ -45,7 +45,7 @@ variables: - salome.sg : salome object to communicate with the graphical user interface (if any) - methods: - - updateObjBrowser(bool): + - updateObjBrowser(): - SelectedCount(): returns number of selected objects - getSelected(i): returns entry of selected object number i diff --git a/src/KERNEL_PY/batchmode_salome.py b/src/KERNEL_PY/batchmode_salome.py index 9e036ec88..8d60ebadf 100755 --- a/src/KERNEL_PY/batchmode_salome.py +++ b/src/KERNEL_PY/batchmode_salome.py @@ -105,7 +105,7 @@ def IDToSObject(id): #-------------------------------------------------------------------------- -def PersistentPresentation(theStudy, theSO, theWithID): +def PersistentPresentation(theSO, theWithID): # put the sobject's content (with subchildren) to the string aResult = "" attrs = theSO.GetAllAttributes() @@ -154,9 +154,9 @@ def PersistentPresentation(theStudy, theSO, theWithID): aResult = "sobject: " + theSO.GetID() + " nbattrs: " + str(aLen - anUncopied) + aResult + '\n' else: aResult = " nbattrs: " + str(aLen - anUncopied) + aResult + '\n' - anIter = theStudy.NewChildIterator(theSO) + anIter = myStudy.NewChildIterator(theSO) while anIter.More(): - aResult += PersistentPresentation(theStudy, anIter.Value(), theWithID) + aResult += PersistentPresentation(anIter.Value(), theWithID) anIter.Next() return aResult @@ -178,7 +178,7 @@ def CheckCopyPaste(theSO, theInfo ,theComponentPaste): while aRoot.GetID() != "0:": aRoot = aRoot.GetFather() aTree = GetTree(aRoot) - aStudyPersist = PersistentPresentation(myStudy, aRoot, 1) + aStudyPersist = PersistentPresentation(aRoot, 1) if not myStudy.CanCopy(theSO): raise RuntimeError, " for "+theInfo+" returns false" @@ -191,7 +191,7 @@ def CheckCopyPaste(theSO, theInfo ,theComponentPaste): raise RuntimeError, " for "+theInfo+" returns false" # check: before paste study is not changed check - if aStudyPersist != PersistentPresentation(myStudy, aRoot, 1): + if aStudyPersist != PersistentPresentation(aRoot, 1): raise RuntimeError, "Study is changed before Paste calling for "+theInfo aSObj = theSO diff --git a/src/KERNEL_PY/salome_iapp.py b/src/KERNEL_PY/salome_iapp.py index ac3c674ef..cdd942bd1 100755 --- a/src/KERNEL_PY/salome_iapp.py +++ b/src/KERNEL_PY/salome_iapp.py @@ -77,7 +77,7 @@ class SalomeOutsideGUI(object): """Indicate if GUI is running""" return False - def updateObjBrowser(self, bid): + def updateObjBrowser(self): """update the GUI object browser""" print "SalomeOutsideGUI: no objectBrowser update outside GUI" pass diff --git a/src/KERNEL_PY/salome_study.py b/src/KERNEL_PY/salome_study.py index 7269f8b1c..fc432a30c 100755 --- a/src/KERNEL_PY/salome_study.py +++ b/src/KERNEL_PY/salome_study.py @@ -114,7 +114,7 @@ def generateName(prefix = None): #-------------------------------------------------------------------------- -def PersistentPresentation(theStudy, theSO, theWithID): +def PersistentPresentation(theSO, theWithID): # put the sobject's content (with subchildren) to the string aResult = "" attrs = theSO.GetAllAttributes() @@ -163,9 +163,9 @@ def PersistentPresentation(theStudy, theSO, theWithID): aResult = "sobject: " + theSO.GetID() + " nbattrs: " + str(aLen - anUncopied) + aResult + '\n' else: aResult = " nbattrs: " + str(aLen - anUncopied) + aResult + '\n' - anIter = theStudy.NewChildIterator(theSO) + anIter = myStudy.NewChildIterator(theSO) while anIter.More(): - aResult += PersistentPresentation(theStudy, anIter.Value(), theWithID) + aResult += PersistentPresentation(anIter.Value(), theWithID) anIter.Next() return aResult @@ -190,7 +190,7 @@ def CheckCopyPaste(theSO, theInfo ,theComponentPaste): while aRoot.GetID() != "0:": aRoot = aRoot.GetFather() aTree = GetTree(aRoot) - aStudyPersist = PersistentPresentation(myStudy, aRoot, 1) + aStudyPersist = PersistentPresentation(aRoot, 1) if not myStudy.CanCopy(theSO): raise RuntimeError, " for "+theInfo+" returns false" @@ -203,7 +203,7 @@ def CheckCopyPaste(theSO, theInfo ,theComponentPaste): raise RuntimeError, " for "+theInfo+" returns false" # check: before paste study is not changed check - if aStudyPersist != PersistentPresentation(myStudy, aRoot, 1): + if aStudyPersist != PersistentPresentation(aRoot, 1): raise RuntimeError, "Study is changed before Paste calling for "+theInfo aSObj = theSO @@ -266,24 +266,6 @@ def FindFileInDataDir(filename): #-------------------------------------------------------------------------- -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 - - Obsolete: only one study can be opened at the moment. - This function works properly if specified theStudy parameter - corresponds to the currently opened study. - Kept for backward compatibility only. - """ - global myStudy, myStudyName - myStudy = theStudy - myStudyName = theStudy._get_Name() - return myStudy, myStudyName - - #-------------------------------------------------------------------------- - def openStudy(theStudyPath): global myStudy print "openStudy" diff --git a/src/KERNEL_PY/salome_test.py b/src/KERNEL_PY/salome_test.py index 9d51d2f54..8902e461d 100755 --- a/src/KERNEL_PY/salome_test.py +++ b/src/KERNEL_PY/salome_test.py @@ -163,7 +163,7 @@ print "OK" # ---- update object browser if salome.hasDesktop(): - salome.sg.updateObjBrowser(True); + salome.sg.updateObjBrowser(); print @@ -303,7 +303,7 @@ print "OK" # ---- update object browser if salome.hasDesktop(): - salome.sg.updateObjBrowser(True); + salome.sg.updateObjBrowser(); print @@ -455,4 +455,4 @@ else: # not in gui mode, Paravis can not be tested # ---- update object browser if salome.hasDesktop(): - salome.sg.updateObjBrowser(True); + salome.sg.updateObjBrowser(); diff --git a/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx b/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx index b75cf0843..77d1861b7 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx +++ b/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx @@ -113,7 +113,6 @@ _PTR(Study) ClientFactory::Study(SALOMEDS::Study_ptr theStudy) void ClientFactory::createStudy(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa) { - SALOMEDSClient_Study* study = NULL; #ifdef WIN32 if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME); if(!aCreateFactory) aCreateFactory = (STUDY_CREATE_FUNCTION)::GetProcAddress(_libHandle, STUDY_CREATE); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index ca04c276d..7d838bc5d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -2493,7 +2493,7 @@ bool SALOMEDSImpl_Study::DumpStudy(const std::string& thePath, sfp << std::endl; sfp << "if salome.sg.hasDesktop():" << std::endl; - sfp << "\tsalome.sg.updateObjBrowser(True)" << std::endl; + sfp << "\tsalome.sg.updateObjBrowser()" << std::endl; if(isDumpVisuals) { //Output the call to Session's method restoreVisualState sfp << "\tiparameters.getSession().restoreVisualState(1)" << std::endl; -- 2.30.2