From: Christian Caremoli <> Date: Tue, 6 Jul 2010 12:46:10 +0000 (+0000) Subject: CCAR: suppression des catalogues (packages python) et autres packages (SD) X-Git-Tag: V2_0~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=62f308355b735432d5686ebc7223fda45024e62a;p=modules%2Feficas.git CCAR: suppression des catalogues (packages python) et autres packages (SD) de sys.modules pour pouvoir importer successivement des catalogues de versions differentes --- diff --git a/Aster/Cata/cataSTA10/__init__.py b/Aster/Cata/cataSTA10/__init__.py index f6816918..3cdb1caf 100644 --- a/Aster/Cata/cataSTA10/__init__.py +++ b/Aster/Cata/cataSTA10/__init__.py @@ -5,6 +5,13 @@ sys.path.insert(0,rep_macro) rep_macro=os.path.join(rep_macro,'Macro') sys.path.insert(0,rep_macro) +if sys.modules.has_key("SD"): + del sys.modules["SD"] +for k in sys.modules.keys(): + if k[0:3] == "SD.": + del sys.modules[k] + + from cata import * from math import ceil from Extensions import param2 diff --git a/Aster/Cata/cataSTA9/__init__.py b/Aster/Cata/cataSTA9/__init__.py index 83c43086..4204daed 100644 --- a/Aster/Cata/cataSTA9/__init__.py +++ b/Aster/Cata/cataSTA9/__init__.py @@ -7,6 +7,13 @@ rep_sd = os.path.dirname(__file__) rep_sd=os.path.join(rep_sd,'SD') sys.path.insert(0,rep_sd) +if sys.modules.has_key("SD"): + del sys.modules["SD"] +for k in sys.modules.keys(): + if k[0:3] == "SD.": + del sys.modules[k] + + from cata import * from math import ceil from Extensions import param2 diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index 4a9896cb..a8829081 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -209,6 +209,13 @@ class READERCATA: nom_cata = os.path.splitext(os.path.basename(cata))[0] rep_cata = os.path.dirname(cata) sys.path[:0] = [rep_cata] + + if sys.modules.has_key(nom_cata): + del sys.modules[nom_cata] + for k in sys.modules.keys(): + if k[0:len(nom_cata)+1] == nom_cata+'.': + del sys.modules[k] + try : o=__import__(nom_cata) return o