From 2794f597324373dda3d1c30d1a4661787dfd69ba Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Thu, 3 Oct 2019 14:11:04 +0200 Subject: [PATCH] Find the resources catalog in mode without salome session. --- src/pydefx/pyscript.py | 2 +- src/pydefx/salome_proxy.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pydefx/pyscript.py b/src/pydefx/pyscript.py index a302913..4053c90 100644 --- a/src/pydefx/pyscript.py +++ b/src/pydefx/pyscript.py @@ -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: diff --git a/src/pydefx/salome_proxy.py b/src/pydefx/salome_proxy.py index bb1155b..9067760 100644 --- a/src/pydefx/salome_proxy.py +++ b/src/pydefx/salome_proxy.py @@ -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 -- 2.39.2