From 7abfafb698042a8635b7cbf9d2347937f2036ba8 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 28 Jun 2006 10:41:34 +0000 Subject: [PATCH] Fix possible problems with custom SALOME modules (resources folder does not include module name). --- bin/runSalome.py | 55 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/bin/runSalome.py b/bin/runSalome.py index 2c2c9fc02..722629ad4 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -353,11 +353,21 @@ class CatalogServer(Server): module_root_dir=modules_root_dir[module] module_cata=module+"Catalog.xml" #print " ", module_cata - cata_path.extend( - glob.glob(os.path.join(module_root_dir, - "share",salome_subdir, - "resources",module.lower(), - module_cata))) + if os.path.exists(os.path.join(module_root_dir, + "share",salome_subdir, + "resources",module.lower(), + module_cata)): + cata_path.extend( + glob.glob(os.path.join(module_root_dir, + "share",salome_subdir, + "resources",module.lower(), + module_cata))) + else: + cata_path.extend( + glob.glob(os.path.join(module_root_dir, + "share",salome_subdir, + "resources", + module_cata))) pass pass self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2 @@ -467,10 +477,20 @@ class SessionServer(Server): module_root_dir=modules_root_dir[module] module_cata=module+"Catalog.xml" #print " ", module_cata - cata_path.extend( - glob.glob(os.path.join(module_root_dir,"share", - salome_subdir,"resources", - module.lower(),module_cata))) + if os.path.exists(os.path.join(module_root_dir, + "share",salome_subdir, + "resources",module.lower(), + module_cata)): + cata_path.extend( + glob.glob(os.path.join(module_root_dir,"share", + salome_subdir,"resources", + module.lower(),module_cata))) + else: + cata_path.extend( + glob.glob(os.path.join(module_root_dir,"share", + salome_subdir,"resources", + module_cata))) + pass if (self.args["gui"]) & ('moduleCatalog' in self.args['embedded']): self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2 else: @@ -508,10 +528,19 @@ class ContainerManagerServer(Server): module_root_dir=modules_root_dir[module] module_cata=module+"Catalog.xml" #print " ", module_cata - cata_path.extend( - glob.glob(os.path.join(module_root_dir,"share", - self.args['appname'],"resources", - module.lower(),module_cata))) + if os.path.exists(os.path.join(module_root_dir, + "share",salome_subdir, + "resources",module.lower(), + module_cata)): + cata_path.extend( + glob.glob(os.path.join(module_root_dir,"share", + self.args['appname'],"resources", + module.lower(),module_cata))) + else: + cata_path.extend( + glob.glob(os.path.join(module_root_dir,"share", + self.args['appname'],"resources", + module_cata))) pass pass if (self.args["gui"]) & ('moduleCatalog' in self.args['embedded']): -- 2.39.2