From d91bc9f4fc9c64998ca72d5bdf87ada85ce3eb5b Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 22 Jun 2005 15:23:32 +0000 Subject: [PATCH] Fix a bug with SWIG 1.3.24 - the swigged library should be loaded only once to the Python interpreter --- src/KERNEL_PY/kernel_shared_modules.py | 1 + src/KERNEL_PY/salome_iapp.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/KERNEL_PY/kernel_shared_modules.py b/src/KERNEL_PY/kernel_shared_modules.py index 76129eecd..b218ef6d3 100755 --- a/src/KERNEL_PY/kernel_shared_modules.py +++ b/src/KERNEL_PY/kernel_shared_modules.py @@ -10,6 +10,7 @@ from import_hook import register_pattern register_name("qt") register_pattern(lambda(x):x.endswith("_idl")) +register_pattern(lambda(x):x.endswith("_Swig")) register_name("omniORB") import omniORB diff --git a/src/KERNEL_PY/salome_iapp.py b/src/KERNEL_PY/salome_iapp.py index befa0d075..e6ebcaf16 100644 --- a/src/KERNEL_PY/salome_iapp.py +++ b/src/KERNEL_PY/salome_iapp.py @@ -24,7 +24,6 @@ # Module : SALOME # $Header$ -from libSALOME_Swig import * import salome_ComponentGUI #-------------------------------------------------------------------------- @@ -54,9 +53,6 @@ def SalomeGUIgetAllSelected(self): listSelected.append(self.getSelected(i)) return listSelected -class SalomeGUI(SALOMEGUI_Swig): - getAllSelected = SalomeGUIgetAllSelected - #-------------------------------------------------------------------------- salome_iapp_initial = 1 @@ -67,8 +63,12 @@ def salome_iapp_init(): if salome_iapp_initial: salome_iapp_initial=0 + import libSALOME_Swig + class SalomeGUI(libSALOME_Swig.SALOMEGUI_Swig): + getAllSelected = SalomeGUIgetAllSelected + # create a SALOMEGUI_Swig instance sg = SalomeGUI() - IN_SALOME_GUI=sg.hasDesktop() + IN_SALOME_GUI = sg.hasDesktop() return sg -- 2.39.2