]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix possible problems with custom SALOME modules (resources folder does not include...
authorvsr <vsr@opencascade.com>
Wed, 28 Jun 2006 10:41:34 +0000 (10:41 +0000)
committervsr <vsr@opencascade.com>
Wed, 28 Jun 2006 10:41:34 +0000 (10:41 +0000)
bin/runSalome.py

index 2c2c9fc022671bf36831a86207243dde60bd5c90..722629ad4694265738e3dee09443f937a813f01c 100755 (executable)
@@ -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']):