Salome HOME
Find the resources catalog in mode without salome session.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 3 Oct 2019 12:11:04 +0000 (14:11 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 3 Oct 2019 12:11:04 +0000 (14:11 +0200)
src/pydefx/pyscript.py
src/pydefx/salome_proxy.py

index a3029138a14726140c28976289b49c07c01a7128..4053c903366d9c37bc95a6f40e439f9b5cb8f746 100644 (file)
@@ -89,7 +89,7 @@ class PyScript:
     error_string = ""
     if len(self.errors) > 0:
       error_string = "global errors:\n"
-      error_string += '\n'.join(errors)
+      error_string += '\n'.join(self.errors)
     else:
       properties = self.getFunctionProperties(fname)
       if properties is None:
index bb1155b34026304bbb54bf2b49e418526b301251..906776010629203965a9b302c35fcf7f14d9bcaf 100644 (file)
@@ -42,6 +42,11 @@ def getResourcesManager():
       _resourceManager = salome.lcc.getResourcesManager()
     else:
       catalog_path = os.environ.get("USER_CATALOG_RESOURCES_FILE", "")
+      if not os.path.isfile(catalog_path):
+        salome_path = os.environ.get("ROOT_SALOME_INSTALL", "")
+        catalog_path = os.path.join(salome_path, "CatalogResources.xml")
+      if not os.path.isfile(catalog_path):
+        catalog_path = ""
       _resourceManager = pylauncher.ResourcesManager_cpp(catalog_path)
   return _resourceManager